Skip to content
This repository has been archived by the owner on Sep 14, 2020. It is now read-only.

Export fixes #182

Open
wants to merge 3 commits into
base: 1.0.0-wip
Choose a base branch
from
Open

Export fixes #182

wants to merge 3 commits into from

Commits on Nov 16, 2015

  1. Clone a collection's select object when cloning the collection

    PHP object cloning is shallow. Therefore, any objects owned by the
    cloned object are also owned by the original object, because it's all
    passed around by reference. This means that if the select object is
    modified after the clone, this will still affect the original
    collection's select object. This creates problems when you have
    collections that modify the select object in the _beforeLoad() method.
    
    We encountered issues when exporting the Sales Transactions grid,
    where it would complain that it had already added a column name
    correlation whenever it reached the 2nd page when exporting a
    collection. This was happening because it was using the same shared
    select object from the original collection.
    
    To get around this, we now clone the original select object, and
    manually set it on the cloned collection on each iteration of the loop,
    using reflection to do so. This appears to work fine for all grids, and
    is a general improvement.
    
    It is worth noting that this exact issue is probably why Magento never
    made exporting possible on some grids, such as the Sales Transactions
    grid.
    Matthew Gamble committed Nov 16, 2015
    Configuration menu
    Copy the full SHA
    2b89bcd View commit details
    Browse the repository at this point in the history
  2. Fix for transactions grid collection not being reloaded properly

    The extension relies on the fact that a new collection object is created
    during the second call to _prepareCollection(). This doesn't happen with
    the transactions grid, because it always first looks to see if there is
    a collection already set. It does this because there is a subclass which
    also creates a collection, and utilises this class to do most of the
    work.
    
    We don't need this for the main transactions grid, so we unset the
    collection before calling _prepareCollection() for the 2nd time. This
    makes everything work a lot more nicely.
    Matthew Gamble committed Nov 16, 2015
    Configuration menu
    Copy the full SHA
    1ac0401 View commit details
    Browse the repository at this point in the history
  3. Bump rewrite code version to reflect new changes

    Matthew Gamble committed Nov 16, 2015
    Configuration menu
    Copy the full SHA
    4812ef5 View commit details
    Browse the repository at this point in the history