jayelkaake/enhancedgrid

Enhanced Grid reverts to stock during any Ajax update

Morgon opened this issue · 18 comments

Similar to #30 and other reports, my grid seems to be reverting back to the standard Magento grid during any update to it via Ajax.

I remember this started doing it around the time of the SUPEE-6788 patch craziness, and I've just now updated the extension in hopes to fix it... but no dice.

Not entirely sure what information I can provide to help or where I should be looking for answers within the code itself. Magicento reports no rewrite conflicts with the Grid, nor can I find any extension that rewrites adminhtml/catalog_product

Any troubleshooting tips?

Are the right files there? Including the ones from the layout? if the admin layout files are missing this might happen.

Hi @jayelkaake, thanks for the response.

Yes, all files are there as far as I can tell. I pulled down the latest from git and copied the files into app and js respectively.

Debugging this would be a lot easier if the entire extension wasn't working, but initial load and page refreshes are fine (/admin/catalog_product/index/key/...) . It's only on the ajax portions (search, pagination - /admin/catalog_product/grid/key/.../page/2/?ajax=true&isAjax=true) that is reverting.

Oddly, even though the Grid shows, I put some Mage::log() calls into TBT_Enhancedgrid_Catalog_ProductController and didn't get any output even for indexAction.. so now I'm double-confused on how it's working at all.

Quazz commented

I am experiencing the same thing right now.

Any Ajax action reverts the layout to default. Navigating via Admin menu to Manage Products * brings back the enhanced grid.

We are also experiencing this bug, after a recent install. The plugin works fine, however performing an Ajax action such as filtering by sku, status or category reverts back to the default grid.

Hitting enter or searching again without altering the search parameters return. Refreshing the page gives you the expected results, implying that the parameters are set properly, but during an ajax call the route for the old grid is still being retrieved.

@jayelkaake - Any chance you've been able to look into this over the past few months? This is still occurring, apparently to several people.

I realize a few people are running into this but it's definitely something not happening on all stores. I just installed a fresh Magento 1.9.2.4 and all the filters work exactly as expected and don't reset.

I'd like to help figure out what's causing it, so please, can everyone provide:

  1. Magento Version
  2. List of other extensions and whether or not they have any Grid rewrites (visible in the module's config.xml)
  3. List of any modules changing anything in the adminhtml catalog_product xml files.

I'm willing to bet the issue is some other extension overwriting the grid layout xml to add it's own column.

Thanks for responding, @jayelkaake

Magento Version EE 1.14.2.2
TBT_Enhancedgrid is the only module rewriting widget_grid_column or catalog_product

Again, this isn't happening with the initial load (which would make this a lot easier!) - it's only when using the Ajax controller to update the grid.

Hmm I've not tested this on MEE. I wonder if that's related...
Can you do this:

  1. Open up your chrome or firefox web console.
  2. Do a filter or search.
  3. See what URL the Ajax request goes to and let me know.

Sure:

https - //site/admin/catalog_product/grid/key/_key_/product_filter/cHJpY2UlNUJjdXJyZW5jeSU1RD1VU0QmY3JlYXRlZF9hdCU1QmxvY2FsZSU1RD1lbl9VUyZzcGVjaWFsX3ByaWNlJTVCY3VycmVuY3klNUQ9VVNEJnNwZWNpYWxfZnJvbV9kYXRlJTVCbG9jYWxlJTVEPWVuX1VTJnNwZWNpYWxfdG9fZGF0ZSU1QmxvY2FsZSU1RD1lbl9VUyZjb3N0JTVCY3VycmVuY3klNUQ9VVNE/?ajax=true&isAjax=true

The base64 request payload decodes to
price%5Bcurrency%5D=USD&created_at%5Blocale%5D=en_US&special_price%5Bcurrency%5D=USD&special_from_date%5Blocale%5D=en_US&special_to_date%5Blocale%5D=en_US&cost%5Bcurrency%5D=USD

Note that I didn't actually filter anything, as you can tell above; I just did a blank search. If I add data to filter in any of the configured custom fields, it does carry over to the payload request, so it doesn't seem the grid itself is broken (at least initially).

Is this of any help?

That key/key/ part looks...odd. Here's what I'm seeing on a test store of mine locally (pretty much fresh):
!p[(http://g.recordit.co/wfncDuow78.gif)
URL comes out as http://[base_url]/index.php/[admin_path]/catalog_product/grid/product_filter/cHJpY2UlNUJjdXJyZW5jeSU1RD1DQUQ=/?ajax=true&isAjax=true

Can you send a screen video of your grid? (I use http://recordit.co on OSX FYI)

Admin Secret Keys are pretty standard (at least in my experiences). But just out of my own curiosity, I disabled them to see if that had anything to do with anything, but it didn't:

https://[site]/index.php/[admin]/catalog_product/grid/product_filter/cHJpY2UlNUJjdXJyZW5jeSU1RD1VU0QmY3JlYXRlZF9hdCU1QmxvY2FsZSU1RD1lbl9VUyZzcGVjaWFsX3ByaWNlJTVCY3VycmVuY3klNUQ9VVNEJnNwZWNpYWxfZnJvbV9kYXRlJTVCbG9jYWxlJTVEPWVuX1VTJnNwZWNpYWxfdG9fZGF0ZSU1QmxvY2FsZSU1RD1lbl9VUyZjb3N0JTVCY3VycmVuY3klNUQ9VVNE/?ajax=true&isAjax=true

Still spitting out the base grid.

Here's a short movie. Apologies for the size, it took me quite a while to get Premiere to give me a small enough size to upload.

I click into Manage Products to show the grid with the customized columns
Enter a filter value, click Search
Grid reloaded as default.
(Note: I do not have this set to loop because it's jarring in this case; refresh the page to repeat)

http://i.imgur.com/s7JZ3kz.gifv

Seems that you're replying via email. I've modified the comment a couple of times because imgur was being weird with my upload. New one is http://i.imgur.com/s7JZ3kz.gifv

Nope, no log output. As far as Magento is concerned, it believes everything is working 'fine'.

I can't recreate the error locally on any of my clients' sites (though none of the current ones are MEE) so it's really hard to help. Maybe giving you some insight on how the grid gets rendered would help you figure it out:

  • When you hit the controller https://[site]/index.php/[admin]/catalog_product/grid there is some code in TBT/Enhancedgrid/etc/config.xml that tells Magento to first use it's own controller method before using the the Mage_Adminhtml one.
  • The only thing I can think of is maybe something (which could be MEE) is getting higher priority on the route than Mage_Adminhtml. If you do a mass search your code base (including MEE code) base and look for something like what you see here: https://github.com/jayelkaake/enhancedgrid/blob/master/app/code/community/TBT/Enhancedgrid/etc/config.xml#L9-L17
  • If something IS getting priority, then the solution would be to give enhancedgrid priority, which would mean updating the etc/config.xml or some other way.

Hopefully that helps.

Eureka! You are correct, and now I feel silly.

While nothing was directly overriding the grid itself, you pointed me to the right direction by mentioning the router, which took me to the controller itself.

Turns out we had a local modification to the base ProductController, which also has a similar override for the adminhtml router (I was searching for overrides to the widget grid). I'm lucky that this module does not collide with the EnhancedGrid methods, so I am able to simply mark it as a descendent of TBT_Enhancedgrid. Others may need to do a little more work.

Thank you for your patience and relatively thorough explanation.