I'm using D7.0

In my 'recent Log Messages' I'm getting repeated 'Page Not Found' 'misc/jquery.cookie.js' messages. It doesn't appear when visitors use the site, only when I access some of the admin pages such as (for example) admin/structure/block or admin/structure/types/manage/story/fields

I have checked my misc/jquery.cookie.js file. It is there and appears to be correct.

Anyone know what's causing this, and how I can correct it?

Comments

brightbold’s picture

Exact same problem. It's there, but admin pages (including admin/people/create and admin/structure/menu/manage/main-menu?render=overlay) have been triggering this error. If I figure anything out I'll post it here.

ayesh’s picture

Can you request that file from server anonymously ?

Turn of JS aggregation and try again.

Technonow’s picture

Sorry!

How do I do that?

brightbold’s picture

I also am having a problem where the drag-to-reorder feature isn't working and I can only change the order of menu items, content fields, etc. by editing the weight field. In researching that I see that this issue http://drupal.org/node/996240 refers to jquery.cookie.js, so I wonder if these two issues go hand-in-hand.

Dirk, is tabledrag working for you?

Technonow’s picture

No. Drag and drop not working.

sudotrin’s picture

http://drupal.org/node/1017612#comment-3994268

For me it was caused by a security measure on my shared hosting demo account.
User unik saved me!

What I've done is a copy of /misc/jquery.cookie.js file and put it in my theme's (bartik) directory.
I renamed it from jquery.cookie.js to jquery_cookie.js and put it to my template by adding:
scripts[] = jquery_cookie.js
to my bartik.info file.

I had to do this for both my front-end theme and my administration theme. I just spent days trying to figure this out - hopefully this will help someone else!

fauskanger’s picture

Thanks a bunch!

The update to 7.2 replaced the bartik.info - file :)

This really helped! Thanks again!

drupal_web_developer’s picture

I had same issue and I have spent my couple of hours in trying to solve this issue.
But You have saved my life. Thx :)

beceri’s picture

you can go configuration>performance>enable Aggregate JavaScript files.

after that file not found mistake will be lost

I try that is work

brightbold’s picture

Thanks beceri, that does seem to work!

eusofzay’s picture

Thanks it worked for me too.

I love this feature of drupal.. I mean the drupal community :)

kenny22’s picture

stops the error for me but also stops admin overlay working as well

kenny

popzkg’s picture

wow!!! worked great
thanks a lot..

sliveroix’s picture

thanks a lot beceri

mwbyrd’s picture

this is the error I get when doing a bulk delete of nodes

An AJAX HTTP error occurred. HTTP Result Code: 500 Debugging information follows. Path: /batch?id=104&op=do StatusText: Internal Server Error ResponseText:

cristianpark’s picture

Thanks for your answer, it worked just fine to me!!!

hestros’s picture

Actually the overlay is an iframe and if you check the DOM (firebug ) you'll see that the header is missing the jquery.cookie.js, although the actual page is included it. My guess is this is not a bug, but I don't know exactly why.
This has to do with the D7 core behaviors (Drupal.behaviors) and it results to unaccessible $.cookie function while in overlay mode. Switching off the overlay module will present administration pages without iframe and $.cookie is at disposal again.
If insist to work on overlay modal and use the $.cookie you must recreate a cookie function that runs out of Drupal.behavior[.yourmodule] or at least not in attach (property-function)and based on document.cookie (not $.cookie function).
Note that when the form (in modal or not) is processed the action is referred to the main page (not the iframe) and thus the function is accessible, so the custom function has to be focused only to read cookie data or to read/write ajax type actions need to be written.
Calling the jquery.cookie.js from an other location (as mentioned ) it will be increase with the same value the js list somewhere in the Drupal.settings (and eventually the $javascript array from the [new hook] js_alter) and this might brake things, so it's not advisable.
That way you can roll back to original D7 header when you (and users) are on the main window.
Hope I'm not confusing things, but I solved a similar problem and that's my most Drupal way to solve it.

yuvalbh’s picture

so, what is your result. can you give steps to solve the problem

georgechenley’s picture

Same problem. Thanks for your answer, but could you make some simple step-by-step FAQ?
I think it will be usefull not only for me.

Thanks one more time!

ducnguyen’s picture

Thanks so much, beceri.

I just registed to say "thanks" to you.
Hope you will always be good.

johnw3600’s picture

Hi. I had the same error. After I migrated my site from a subdirectory to public_html on a shared server.

I tried copying jquery.cookie.js to jquery_cookie.js and referencing it in the theme's info file. (as suggested above)
That didn't work because it just meant the error shifted along to the next js file required... so not a great solution.

I tried the aggregation of jquery (also suggested above) but that didn't work either. Nor did I expect it to, because if the file cannot be located (or something its looking for cannot be located) why should aggregating all the js files required be any better? It is either going to be missing in the aggregation or else if something it was looking for was missing then the aggregation cannot fair any better!

But let me add specifics, even though the error message report is exactly Dick reported. I have jcarousel installed and working (brilliantly and beautifully) in a sub-folder of a domain, ready for my new glossy shiny beautiful drupal site to take over from a horrid boring plain HTML one! So just for the moment the old site is at domain.com and the new one at domain.com/drupal. All works well. The site is multilingual, and yes I've made that work as well, and it not only has all the common js stuff that runs the overlays etc etc, but also views-accordion to that invokes jquery.ui.accordion.js. And EVEN a workaround for the fact that views_accordion supports 'fields' not 'panel fields' at this time. Brill!

Then (very late last night) I shifted the drupal site up to domian.com (with lots of care & backups etc), took care over shifting site/default/settings.php with its 555 permissions, deleted cache, and opened the site. Disaster struck in the form of that error, and whirling circles where the jcarousel's image content should be! I've looked at very conceivable place where a site URL might appear, I can't find anything that's stopping it from finding the content. All images pass through the image-styles system and if I access any node the images are instantly there. I have even opened each node for editing so that the node system is forced to refresh the styles private repository with thumbnails which the carousel needs (and would usually trigger). Nothing!

By 2 am I had been forced to put the old site back!

But I believe the error message is a complete red herring! I am so sure that it is the content that cannot be found, not the javascript! What's more the views-accordion worked perfectly after the bump up the directory structure, and surely it is relying on the same js files or at very least others in the same directory! I've come to the conclusion that it can only be one of two things: (1) .htaccess was specifically blocking the use of js files because I had not succeeded to getting the right .htaccess file into place. Note: Shared server... a lot of trouble trying to even LOOK at an .htaccess file! Or, (2) much more likely, when jcarousel was installed it wrote SOMETHING in SOMEWHERE in the database, in a BLOB field I can't read, that hard-wires the images folder for faster access!!!

Now I've disabled and re-enabled jcarousel with no effect, but I think I'm forced to DELETE all carousels (I have three and they were quite a bit of work) UNINSTALL jcarousel, bump the site up the directory structure, RE-INSTALL it, re-create my carousels. And all on a live site - just to see if it works!

Has anyone please got any better suggestions??
Many thanks for reading.
John W

b8x’s picture

mbrett5062’s picture

I had the same issue, and looked at all of the solutions suggested here.
None of which are suitable, as they would involve a hack of core system.module
The real solution is the following.

After much investigation, I found that the issue is on apache servers, the Mod Security is throwing a false positive against this file name.

The error message indicates rule # 950004 is triggering for the url /misc/jquery.cookie.js.

The solution is to get your hosting provider to delete this rule from Mod Security, or do it yourself if you are on a dedicated server.

There is a cPanel add-in that will aid in this.
Follow this link for the add-in http://www.configserver.com/cp/cmc.html

Here is a link to the cPanel forum were this issue is discussed and the solution outlined.

http://forums.cpanel.net/f5/mod-security-blocking-jquery-cookie-javascri...

And for those of you who wish to manually change Mod Security here is the code

<LocationMatch /misc/jquery.cookie.js> 
<IfModule mod_security2.c> SecRuleRemoveById 950004 # SecRuleEngine Off </IfModule> 
</LocationMatch>

Remember, do not hack core. It is very bad practice, and the other solutions here all require a hack.

Hope this helps.

tarekdj’s picture

@mbrett5062 you are absolutly right! all files named *cookie*.* are denied.
I've written a quick module to bypass this issue.
https://github.com/tarekdj/custom
Hope this helps to not hack the core.

Egmund’s picture

Thank you very much tarekdj - you saved my life (or at least (some of) my business).

Just wondering: Hopefully someone have reported this as a bug/issue in Dru7???