I'm having some extension adding in a script element to the head with a broken URL that keeps on 504'ing. This is occurring on a test server where I don't have full FTP permissions so editing files under app/etc/modules is out of the question. I've tried going through each extension under configuration > advanced > advanced, but still am not able to find the culprit. The script URL is just "domain.com/skin/frontend/[theme]/enterprise" as shown in this screen cap: enter image description here

If I go under configuration > general > design > themes and set 'Default' to blank (currently set to enterprise), the script link url changes to "domain.com/skin/frontend/[theme-name]/default".

I've tried to grep in the layout directory for 'addJS' and 'addItem', but couldn't find anything helpful..

Is there some code I can add somewhere that adds comments or something that shows which module is loading in the scripts into the head?

  • Have you tried running this command (on linux): fgrep -R "prolighting" /path/to/magento
    – espradley
    Commented Oct 2, 2017 at 16:43
  • @espradley I originally used grep -rn "SEARCHTERM", but I ran your fgrep against 'prolighting', 'enterprise', 'addJs', and 'addItem', but no luck yet.
    – T_K
    Commented Oct 2, 2017 at 17:38
  • Yea, I just realized the "prolighting" is probably the name of your theme. So that's not going to find it. What I've done in the past in these situations is find the addJS code in the code base and then either use xdebug or log write to figure out what's being sent.
    – espradley
    Commented Oct 2, 2017 at 17:43
  • @espradley Ok, so I'm at least on the right track with 'addJs' under the code base. Unfortunately, I don't have access to install xdebug so that's ruled out. How would I use log write instead? Do you have a link to a page that explains the process by chance?
    – T_K
    Commented Oct 2, 2017 at 18:06

1 Answer 1


I'm not sure if you can modify files, but look at the app/code/core/Mage/Core/Model/Layout/Update.php method getFileLayoutUpdatesXml(). It reads all layout updates for the current theme. Find line $fileStr = file_get_contents($filename);

$fileStr contains content of every loaded layout file, $filename — path to the file.

So something like

$fileStr = file_get_contents($filename);
if (strpos($fileStr, 'myfile') !== false) {
    file_put_contents('files.txt', $filename.PHP_EOL, FILE_APPEND);

can store into file.txt paths to files that mention your string.

But JS/CSS files can be added via blocks, look at the Mage_Page_Block_Html_Head::addItem() for more information

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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