Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is Magento 1.4 including javascript files by filesystem path?

I am in the process of testing a Magento 1.3 site using Magento 1.4. I am seeing very weird and inconsistent behavior. Instead of including the URL of my javascript files, Magento is creating tags with the full filesystem path of the js files, as so:

<script type="text/javascript" src="/home/my_username/public_html/js/prototype/prototype.js"></script>

I believe this is related to the new "Themes JavaScript and CSS files combined to one file" function. In fact, when I log into the admin and click "Flush JavaScript/CSS Cache", then the first page load is successful, and I see a single JS include similar to:

<script type="text/javascript" src="/media/js/5b8cfac152fcb2a5f93ef9571d338c54.js"></script>

But subsequent age loads load every single JS file, with the full path names. Which obviously isn't going to work. Anyone have any ideas on what could be wrong or how to fix this issue?

like image 256
Josh Avatar asked Jan 26 '10 19:01

Josh


2 Answers

It was permissions issue in my case. These ssh commands run in the root directory of Magento fixed it:

    # chown all to proper user and group, ie. www-data
    chown -R www-data:www-data *
    # change all files permissions to 644
    find . -type f -exec chmod 644 {} \;
    # change all directories permissions to 755
    find . -type d -exec chmod 755 {} \;
    # change all to be writable in var and media directories
    chmod -R 777 var/ media/

If it still doesn't work then change these two values for path column in the core_config_data in MySQL from "1" to "0":

  • dev/css/merge_css_files
  • dev/js/merge_files
like image 58
marcinsdance Avatar answered Nov 11 '22 01:11

marcinsdance


go to System -> Configuration -> Developer Settings -> Javascript Settings -> Merge JavaScript Files (beta) and set it to "no". It is realy a beta :D

like image 9
ThaKilla Avatar answered Nov 11 '22 02:11

ThaKilla