Magento CE on server running Apache & PHP5.4.

Woke up this morning to discover our store's order grid had disappeared from our admin panel this morning without logging errors. I immediately assume someone had installed or modified something they shouldn't have so I jump in and check our version control - nothing changed in Git. I then check SSH history and I'm showing nothing new. The extensions we have in place still seem to be running without issue. I then proceed to tail PHP, Apache and MySQL logs. No warnings while refreshing the order page. I disabled all local extensions and manually disabled a few community extensions that I thought could be at fault. There are also no console errors reported in the browser.

The last grid related file to load on the page is adminhtml/default/default/template/widget/grid/container.phtml. The footer still renders without issue, it just doesn't want to load the next file which is adminhtml/default/default/template/widget/grid.phtml.

enter image description here

The only thing I can conclude is that there is something wrong with the results of the SELECT query that runs to generate the data seen in the order grid. We have an international ordering integration that has the ability to modify Magento order statuses and reflect various types of currency however I'm not seeing any orders sent from their system.

So now I'm proceeding to check the database itself, I'm looking at sales_flat_order and sales_flat_order_grid for corrupt data of some sort. As mentioned above, MySQL isn't reporting anything but I'm not sure if it would in a situation like this.

Question: Does anyone know the specific query that is ran in order to assemble an order grid in Magento? I'm interested in running it to try and reflect what the order grid itself might be loading and correct any corrupt data that I'm hoping to find. Also open to any other ideas of debugging this specific situation that anyone can suggest. Thanks in advance.

  1. Enable Developer Mode if you haven't already.
  2. Ensure logging is enabled in Magento: System > Configuration > Advanced > Developers
  3. Double Check that no IP has been added under Allowed IPs.
  4. Enable full reporting in PHP via index.php.
  5. Check webserver's error and system log files for any possible fatal exception at that level of the stack.

Adding this to the the Block's constructor may help you get the SQL query being returned if there isn't some other exception occurring before the Widget Grid Container is initialized.


Note: Code is untested but you should be able to grab the collection in any block of the Grid to dump out the query.

Hope this helps, but ultimately it looks like an exception in the blocks before any SQL takes place. There is also a means to log all queries if you need to verify such.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.