Why is Magento 1.4 including javascript files by filesystem path?

前端 未结 10 2116
小鲜肉
小鲜肉 2020-12-29 10:53

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, M

相关标签:
10条回答
  • 2020-12-29 11:32

    Check if your media folder is writeable by the user you webserver runs with. I had a symlink to a folder that was only writeable by root

    chown -R www-data:www-data media
    

    helped.

    0 讨论(0)
  • 2020-12-29 11:32

    I had the same Problem.

    Its because magento can't find a javascript file. Look at your /var/log/exception.log (You have to enable the log in System -> Config -> Developer Options)

    In my log was the following error:

    exception 'Exception' with message 'Warning: filemtime() [function.filemtime]: stat failed for /var/www/js/calendar/lang/calendar-en.js in /var/www/app/code/core/Mage/Core/Helper/Data.php on line 631' in /var/www/app/code/core/Mage/Core/functions.php:245

    So I created the file and voila it works !

    0 讨论(0)
  • 2020-12-29 11:34

    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
    0 讨论(0)
  • 2020-12-29 11:41

    Editing the config.xml didn't do the trick for me, I had to disable it in the database.

    In table core_config_data set the value of the row with path dev/js/merge_files (config_id 772) to '0'.

    Thanks for pointing me in the right direction though!

    This solution is worked for me, thanks.

    0 讨论(0)
  • 2020-12-29 11:43

    The problem is related with the javascript merge option. Unfortunatly the form does not work without javascript. You have to change the merge_files option in app/code/core/Mage/Core/etc/config.xml to 0.

            <js>
                <merge_files>0</merge_files>
                <deprecation>0</deprecation>
            </js>
    

    After that I removed all cache files and session files in var directory.

    0 讨论(0)
  • 2020-12-29 11:48

    I had the same problem and came up with the following solution:

    1. Verify that the permissions on media/js belong to the same user that the magento installation's folder is.
    2. Clean the CSS/JS cache using the admin.

    The combination of the two actually got things back to normal.

    0 讨论(0)
提交回复
热议问题