Using:
drupal 6.19
jquery_media 6.x-1.3
jquery_update 6.x-2.x-dev (jquery 1.3.2)
jquery_ui 6.x-1.4 (jquery ui 1.7.3)
jq 6.x-1.2

I have a lot of PHP errors in my logs that are related to jquery_media.
They are:

file_get_contents(jquery_media.defaults.js) [<a href='function.file-get-contents'>function.file-get-contents</a>]: failed to open stream: No such file or directory in /srv/www/vhosts/mysite/includes/common.inc on line 2466.

I have the "Use default js file" option checked and have the "Default js filepath" option left as jquery_media.defaults.js

The problem only occurs while I have "Optimize JavaScript files" enabled in drupal's performance options at admin/settings/performance

As soon as I turn off javascript optimization the errors go away.

Comments

taladega’s picture

I also get the problem
* warning: file_get_contents(sites/all/modules/jquery_ui/jquery.ui/ui/minified/ui.datepicker.min.js) [function.file-get-contents]: failed to open stream: No such file or directory in /home/dir/public_html/includes/common.inc on line 2466.
* warning: file_get_contents(sites/all/modules/jquery_ui/jquery.ui/ui/minified/ui.datepicker.min.js) [function.file-get-contents]: failed to open stream: No such file or directory in /home/dir/public_html/includes/common.inc on line 2466.

Agileware’s picture

@taladega:
That would appear to be an issue with the jquery_ui module.
You should post an issue in the jquery_ui issue queue.

Agileware’s picture

Title: PHP error: file_get_contents() failed to open stream: No such file or directory in includes/common.inc on line 2466 » Descriptions for "Use default js file" and "Default js filepath" don't give all required info
Version: 6.x-1.3 » 6.x-1.x-dev
Component: Code » Documentation

I just came across this again in dev and it seems the problem is user error, brought on by a slight lack of instruction.

I seems if you have "Use default js file" checked and the default "jquery_media.defaults.js" for the "Default js filepath" option AND you have drupal's "Optimize JavaScript files" option enabled you get this error.

Which is understandable when you look at what is happening behind the scenes.

So you need to generate the javascript output by going to mysite.com/jquery_media.defaults.js then copy the contents into your own javascript file, put that file in your sites file system where you want it and then change the "Default js filepath" to the path of that file.

Then it will work with the "Optimize JavaScript files" drupal setting.

There is some instruction in the description of those two jquery media settings but it still isn't entirely clear.
It would be good if it outlined the process of creating your own default js file.
It also should be mentioned that if you don't, and have the "Use default js file" setting checked it won't work with js optimization.

Also, the description for the "Default js filepath" option mentiones the default value for that setting, but it isn't hard coded, it takes it from the field, so after you have changed that value it doesn't accurately tell you what the default is.