Question

Why do I get a blank tab content area on Magento's Category edit form?

Background


In Magento, I've added an input_renderer to a custom category attribute that produces a drop-down menu (select). The job of the renderer is to append a bit of JavaScript that listens for change events on a "parent" drop-down, and populate itself with options based on the value of that parent drop-down. Here's what I have:

enter image description here

This works fine in my development environment. But on staging, as soon as the General tab content is fetched (which includes my JS code), the content area collapses and goes blank:

  • No JS errors thrown in the console
  • No Warnings/Errors thrown in server logs
  • This only started happening after adding my JS code

I posted a related question last week because I was frustrated that I couldn't find a problem with my JavaScript code. So now I'm coming at it from a different angle.

Others have reported a "white screen" issue, but no solutions given have worked for me.


Any pointers? If you are curious to see my source code, here's the input renderer:

https://gist.github.com/vbuck/5310724

Was it helpful?

Solution 2

Just for the record, it was an issue with a bad variable assignment. I moved the JS into its own file, loaded via a layout update, then initialized it from the block (in getAfterElementHtml). It was here that I discovered one of my variables was not being assigned because of a syntax error in a block method.

OTHER TIPS

Looks like you're doing some funky stuff with your ajax url. My suggestion is to debug it before moving on.

  • Can you see the call in your network tab?
  • Console.log the final url and try it in a new window.
  • You are inserting params in the url after it has been generated... Does that really work?
  • It's an admin module, why aren't you using:

    Mage::helper("adminhtml")->getUrl()

On a side note,

<code>
script language="text/javascript"
</code>

is considered bad practice and you should use

<code>
script type="text/javascript"
</code>. 

It's probably not the source of your problem though.

Hope you got some good pointers.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top