When EU Cookie Compliance is active on a site I am working on, none of the buttons (eg. upload) show up in the IMCE browser. I am unsure whether this a fault with IMCE or EU Cookie Compliance but any help with this would be appreciated.

Thank you.

Comments

richieitchy’s picture

Issue tags: +imce, +EU Cookie

I had this problem too, with a site using fckeditor. It is the javascript/jquery that is causing a conflict. Not being a java guru, to get around the issue I did the following.

As the only users that can upload images/insert images with fckeditor/imce are authenticated users within a specific admin role (eg our staff), although you could use the legal module (to get other users to accept the fact you use cookies), I ammended the eu_cookie_compliance.module files footer and init hooks.

I surrounded the code in each hook with an if statement to see if the user was logged in. eg

<?php

global $user;
if (!$user->uid) { // authenticated user check

original module code here

} // end of user check

?>

This seems to have worked for me, as now the cookie java code is not inserted into any pages once a user has logged into the site.

rsvelko’s picture

StatusFileSize
new2.82 KB

here is a tested patch to add ifs and hook_perm and user_access calls to where needed

Now you have a permission 'see EU Cookie Compliance popup' you could use.

The patch includes an update_hook also to ensure that people who update will have the popup for all roles as before the update..

cheers.

rsvelko’s picture

Status: Active » Needs review
rsvelko’s picture

The use case for anon-s using IMCe is pretty rare so this would fix it for most people.

rsvelko’s picture

StatusFileSize
new3.36 KB

ufff

forgot the README hunks of the pathc...

attaching

Miszel’s picture

It is now applied to the 6.x-1.x branch. Many thanks!

Miszel’s picture

Status: Needs review » Closed (fixed)

fixed in 6.x-1.4. Not a perfect solution but I agree with rsvelko. If someone can afford the time to investigate further, please open this issue and provide a path.

mholloway’s picture

StatusFileSize
new1.66 KB

The new permission is a good temporary fix but it doesn't cater well for sites with lots of roles and users who are for example both editors and site members. As site member they should see the popup, but as editors they need to use imce so the popup should be disabled.

I solved this by adding an explicit check for the path not being "imce":

... && drupal_get_normal_path($_GET['q']) != 'imce') {

The attached patch applies this fix in both places where the new permission is checked.

deadman’s picture

StatusFileSize
new1.38 KB

Another solution is to wrap a "try" / "catch" around the offending Javascript function. This has the added advantage of preventing the error killing any other popup windows where the eu_cookie settings don't get added, not just with IMCE.

the_g_bomb’s picture

Status: Closed (fixed) » Needs review
Miszel’s picture

Ok guys, we need to decide which solution we are going with. It seems to me that #9 is more generic and hence I would opt for it. Any more thoughts?

mholloway’s picture

I've tested patch #9 and it works fine, so I'll vote for that one too as generic solutions are always better.

Miszel’s picture

Status: Needs review » Fixed

Committed #9 to the 6.x-1.x branch

nickfc4’s picture

I quite like that option in #8 but could understand why it's not suitable for everyone. Thanks to everyone who has posted solutions as it has certainly helped me.

Miszel’s picture

Status: Fixed » Closed (fixed)

Thank you guys. It is fixed in 6.x-1.5

gaxze’s picture

Seems like this issue is also present in the d7 version as well.

Miszel’s picture

Yes, this one and a couple of other fixes have yet to be ported to the D7 version.

GinaF’s picture

Do you know when the D7 version will be fixed for this?
Thanks
Gina

Miszel’s picture

This is already fixed in the 7.x-1.x-dev version. If you could install it and let me know if it works, that would be great.

I will create a full release tonight.

GinaF’s picture

This dev version has fixed the problem, upload button now visible again.

When I put this dev version on my test website, I then went to permissions and ticked popup display for anonymous users. I then saw an error message on my website (when I logged out to become anonymous) - sorry, I didn't get a note of it, but it was about a popup variable that was missing.
I fixed this by going into the EU cookie settings page and just saving the existing options (with popup display ticked).

This didn't seem to happen on my live site - don't know if I did anything different in terms of the order of enabling things.
Hope that is some useful info. Thanks for the "upload button" fix.
Gina

Miszel’s picture

fixed in 7.x-1.6