3

I'm having an Issue with SUPEE-8788 and the new uploader feature on a 1.9.1.0 magento. The patch originally created the files in the wrong parent directory (don't know why for now, looks like the root taken for the realtive path was wrong). So these files were created in the /skin/frontend/rwd/default/js/lib instead of the /js/lib:

  • lib/uploader/flow.min.js

  • lib/uploader/fusty-flow.js

  • lib/uploader/fusty-flow-factory.js

enter image description here

I found this with a colleague that had the same issue and he moved the files to the right place, flushed the cache and the new uploader was functional. That worked for one of my websites(1.9.2.4), but not for another one that is 1.9.1.0. I have a js error that says :

Uploader is not defined

No wonder, the 3 new files are not included by looking at the source code. My js are not combined by magento.

I noticed this by reading the patch, I end up having this in the /app/design/adminhtml/default/default/layout/main.xml;

<action method="addJs"><name>lib/uploader/flow.min.js</name></action>
<action method="addJs"><name>lib/uploader/fusty-flow.js</name</action>
<action method="addJs"><name>lib/uploader/fusty-flow-factory.js</name></action>

enter image description here

So the new files were added using the action method addJs but instead of having inside the action tag < script >, I have < name >. Does it make any difference?

I tried to change the < name > with < script >, with no luck. Could this be the cause of the issue and if so, how to fix this?

1

Well, we finally worked it out. We noticed that the /app/design/adminhtml/default/default/layout/main.xml was overridden by another theme (Duh!) so the js calls had to be put into the right layout file.

So to answer if using addJs with name instead of script is working, the answer is yes, it works like the addItem method. Just keep in mind that these two methods won't look for scripts in the same parent folder, as this guy here sums it up:

Using addJs will add a Javascript tag with source file relative to the root directory.

<action method="addJs">
   <script>js/custom.js</script>
</action>

If you want to add a Javascript file relative to the skin directory, you need to use addItem instead.

<action method="addItem">
   <type>skin_js</type>
   <name>js/jquery.js</name>
</action>

Reference: http://blog.alanfung.com/2010/08/addjs-vs-additem-in-magento.html

More details over here: https://blog.liip.ch/archive/2013/10/24/adding-javascript-and-css-files-to-head-section-of-magento.html

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.