1

I'm having an issue where, if you add comments to an order in the admin section, the whole comments box will disappear until you refresh the page.

From what I can see of the code in the back end, the ajax call is supposed to respond with nothing if the update works, but I can't see how it's supposed to be pulling the data for the updated commments for the comments box to replace the one deleted when you submit the form

If anyone has any suggestions it'd be appreciated

1 Answer 1

0

The ajax response shouldn't be empty. In the controller, the following:

$this->renderLayout(); 

means it will try to render the content of that layout handle (defined in app/design/adminhtml/default/layout/sales.xml:

<adminhtml_sales_order_addcomment> <block type="adminhtml/sales_order_view_history" name="order_history" template="sales/order/view/history.phtml" output="toHtml"/> </adminhtml_sales_order_addcomment> 

In your case, if the comment is added, but the response doesn't show anything, I suspect the layout XML isn't loaded properly. That is most likely caused by a third party module, or any manual modifications to the layout files.

Replace your app/design/adminhtml folder (make a backup before) with a clean one from a fresh install, and check if your issue is still present.

7
  • Thanks for the suggestion. I did a diff between a clean install and this version and there don't seem to be any differences. there is a module which extends the OrderController object, but disabling that doesn't resolve the issue Commented May 21, 2015 at 10:07
  • 1
    Did you try adding some debugging at the top of the sales/order/view/history.phtml file to make sure it reaches that point? I would also leave this module as disabled whilst you're testing. Commented May 21, 2015 at 10:10
  • Doesn't seem to load the history.phtml file at all. Also, adding an echo after renderLayout makes whatever it is appear on the page as it should the comments. I also checked the post data and that all seems fine too, so it's just the renderLayout() function that seems to be returning nothing Commented May 21, 2015 at 11:12
  • 1
    Before renderLayout, add this: var_dump($this->getLayout()->getUpdate()->getHandles());, it will show the layout handles that are requested. Make sure adminhtml_sales_order_addcomment is one of them. Commented May 21, 2015 at 13:48
  • 1
    If the correct layout is requested, but the file isn't executed, it means the app/design/adminhtml/default/layout/sales.xml file isn't loaded, or that the layout handle isn't present in this file Commented May 22, 2015 at 8:11

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.