Looks like a very good solution to a very stupid law.
For those of us not in D7 land yet, any plans / scope / how hard do we think a back port to 6 would be?
| Comment | File | Size | Author |
|---|---|---|---|
| #39 | cookiecontrol-backport_to_drupal_6_v7.patch.patch | 13.61 KB | nickbits |
| #24 | cookiecontrol-backport_to_drupal_6_v6.patch | 13.31 KB | nickbits |
| #22 | cookiecontrol-backport_to_drupal_6_v5.patch | 51.48 KB | nickbits |
| #21 | cookiecontrol-backport_to_drupal_6_v4.patch | 51.54 KB | nickbits |
| #20 | cookiecontrol-backport_to_drupal_6.patch | 50.72 KB | nickbits |
Comments
Comment #1
a_c_m commentedAhh crap. RTFFP.
We sure there isn't a work around? Seems like the lib itself requires 1.4.4 :(
Comment #2
buddaI'm speaking with CivicUK regarding their codebase and what limitations using an older Drupal 6 compatible jQuery library imposes.
I'd like to have it running on Drupal 6 too - as most big sites are still on Drupal 6 for the foreseeable future.
In the meantime, if you have time to comb over the cookiecontrol javascript and suggest any changes to make it jquery 1.3.2 compatible I can feed that back to CivicUK to include in the upcoming update.
Alternatively, find a way to get http://drupal.org/project/jquery_update upgraded to support jquery 1.4.4+
Comment #3
buddaFrom some initial jQuery sniffing i noticed the use of .delay() in the cookiecontrol code requires 1.4+
Comment #4
jorditr commentedAnd wouldn't it have the "jQuery Update" module as a requirement?
Comment #5
budda@JordiTR Yes it would have that as a requirement, what about it though?
Comment #6
buddaMaybe we can solve Drupal 6 compatibility with http://drupal.org/project/jqmulti ?
Comment #7
mibfire commentedIs there any chance that it will be backported for 26 may?
Comment #8
jenifertucker commentedI was also looking for a Drupal 6 solution.
With jQuery version 1.4 and above, this solution worked for Drupal 6 by putting both the javascipt function and generated text into a block.
http://www.civicuk.com/cookie-law/configuration
Thanks to guys at CivicUK for their help :-)
Comment #9
Miszel commentedI developed a different module for Drupal 6 that dosn't require newer jquery. It is available here
Comment #10
jaredray commentedHi Jenifer,
how were you able to use JQuery 1.4, when Drupal 6 JQuery update only goes to 1.3.2?
Thanks,
Jared
Comment #11
hongpong commentedyou may wish to add a link on the project description page for the Drupal 5/6 project which is now available: http://drupal.org/project/eu-cookie-compliance
Comment #12
darrenlambert commentedThis is a great module, and it's a shame it doesn't work with Drupal 6. It does seem trivial to get it working, needing just a requirement of another module, but I suppose that's a heavy dependance for some people.
Comment #13
gpk commentedjqmulti module (#6) uses jQuery noConflict http://api.jquery.com/jQuery.noConflict/ which could be invoked directly by this module to inject jQuery 1.4.4.
However the advantage of relying on jqmulti is that it could avoid ending up with jQuery 1.4.4 (or higher) being loaded more than once, by different modules. Perhaps the Rolls Royce solution would be to take advantage of jqmulti if present and use jQuery.noConflict if not.
Comment #14
nickbits commentedHi All,
I did attempt to backport this to Drupal 6. I have attached what I have done as a patch against D7 dev. To use it you need to first install libraries with jQuery 1.7.2. Then install jQMulti module. Then apply apply this patch against the D7 release.
Unfortunately although the module installs, the admin interface works, the jQuery doesn't seem to run. Hoping someone can help to finish it.
Nick
Comment #15
nickbits commentedThis time with the patch! Will take another look when I get more time...
Comment #16
nickbits commentedI have updated/replaced the D7 API code to D6 code. Also updated the JS to use the jQuery 1.7.2 library. Again please not instructions on previous post (#14). The JS loads, although it doesn't seem to execute for some reason. No other errors are shown.
So the question now is, why doesn't the JS run?
Am still working on it, but if anyone else wants to chip in, please do so.
And yes, before anyone else does mention it, I do use the EU Cookie Compliance module on my D6 sites. I would like to use this module though for various reasons...
Comment #17
nickbits commentedComment #18
joachim commentedMaybe try using the API from jqmulti rather than just the raw JS way?
http://drupalcode.org/project/jqmulti.git/blob/refs/heads/7.x-1.x:/jqmul...
Comment #19
nickbits commentedThanks for that, but have already tried that and get no where, unless I am doing it wrong. I know it is using the correct JS file as if you add
alert("jQuery version = " + $().jquery);to cookieControl-4.1.min it comes up saying it is version 1.7.2. I will give it another go, but am assuming that there is something else that I have missed.
Cheers,
Nick
Comment #20
nickbits commentedLast update for a while. Patch removes remaining errors/warnings from the admin page. I ahve no more time today, but will continue as soon as I get some spare time. If you can, take a look and help to get it working.
As noted before:
I would do each of the modules on their own, I got several error enabling libraries and jQMulti at the same time. The module installs, you can get the admin page and do all the settings, the JavaScript is installed in the page (view the source when you load a page) but at present none of the other code (JS) loads.
Comment #21
nickbits commentedHi All,
New patch attached. Still not working, but I think I may now have finished removing most of the D7 only code. The JS all loads into the footer now. For some reason it still will not execute. Think this may be the jQuery version again, but am looking into it.
Feel free to chip in and help...
Nick
Comment #22
nickbits commentedSorry, wrong version attached previously.
Comment #23
nickbits commentedWorking on last issue, although may be a while before an update. The last issue is that all of the JS code needs to be grouped together to run with the updated jQuery. Or at least that is what it looks like to me...
Comment #24
nickbits commentedYeah....Got it...
Got it working. The code needs a bit of a tidy up and I have not yet tested everything. I ahve had to include the cookiecontrol JS library in the HTML itself. You will note from the code:
essentially the library is loaded twice. Remove the drupal_add_js from above and it still works fine in Safari but not FireFox. Anyway, here is what you need to get it working:
Can I ask the module maintainer if we can add this as a starting point to a D6 branch?
Can I also ask you all to try it (NOT ON PRODUCTION SITES), report back on what works and doesn't, and if you can, submit patches/corrections.
Comment #25
nickbits commentedHas any one had chance to test it yet?
Comment #26
goron commentedHi. I'm the maintainer of jQuery Multi. I came across this issue and thought I should comment. First, I'd recommend testing with the latest dev of jqmulti. It has a few fixes, including one for the errors when enabling it and libraries together.
More importantly, you should be able to get this working without this part:
Second, for this part:
Why don't you do drupal_get_path('module', 'cookiecontrol')?
Third, you really don't need to do this:
That's the point of the jqmulti hooks, that you shouldn't need to add aliases to packaged libraries like this one. You should only need to implement the jqmulti_files() hook, and possibly also call drupal_add_js() on that same file to make sure it gets loaded (the jqmulti hook will ensure it gets loaded with the newer jQuery version).
One way to see whether it's working is to look at the HTML. You should see jQuery 1.4.4 (or whatever version you're using) loading, followed by cookieControl.min.js, followed by a script called switch.js. If this is not happening, something is wrong. Please post in the jqmulti issue queue if you have more issues, so that we can figure out what the problem is and if there is a jqmulti bug at play here.
Comment #27
nickbits commented@goron Thanks for the reply. I was/am using the latest dev release of jqmulti, I always make sure that I use the latest release. I still get the errors though when enabling all the modules together. I had not done it on a clean drupal install so was not too sure if it was jqmulti or something else causing the problem.
As for the other, oops on the second point, didn't spot that, however it is commented out anyway as that was the jqmulti hook, or part of it, that I was having issues with.
As for the third point, I could not get the jqmulti hooks to work, not how I thought they should anyway, hence the reason I did it that way. Also, at that point in the file I was having issues getting drupal_add_js() to output to the footer region. Switch.js was loading fine.
I will then give the hooks another go.
Thanks,
Nick
Comment #28
joachim commented> First, I'd recommend testing with the latest dev of jqmulti. It has a few fixes, including one for the errors when enabling it and libraries together.
Could you make a new beta release if the current one has problems that are fixed? For people to test this module here it would be easier to point them at a release rather than a dev version. Thanks for all your feedback!
Comment #29
goron commentedSure. I was waiting for some things to happen in the D7 version, but no real reason to do that.
New release is out (6.x-1.0-bet2). I'm also including some better instructions in the README. I know that using the module can be a bit confusing, so I've tried to clarify it there.
Nick, the second point in my post could have to do with why jqmulti wasn't working as well. If you still can't get it to work, please write in the jqmulti issue queue and I'd be happy to try to help out there.
Comment #30
nickbits commented@goron thanks, will try and test it out with the new version of jqmulti. I expect that it is me doing something silly. Anyway, I was hoping that people would at least test the current patch in #24 and confirm, or not, if that at least works.
Will see if I can put some time aside later this week and get it to play nicely with jqmulti.
Thanks,
Nick
Comment #31
nickbits commentedHi All,
I have done no more work on this, and unless anyone else gives feedback on it or needs it, I will stop working.
Nick
Comment #32
teranex commented@nickbits: I have tested the module. While I could get it working on Drupal 6, I still see the session and has_js cookies being set. I'm not sure if this is expected behaviour?
If I see the original Cookie Control website, it let's me configure the widget do request explicit permission to set cookies. Is this configurable from in the module?
I would be interested in a fully working Drupal 6 version of this module. Thx for the work so far!
Comment #33
nickbits commentedThat means it works as intended. To disable those cookies need you to use the JS to enable/disable them. see the Developers section on the module page. It may be something that can be added to the module, or as a sub-module, but think first thing is to get a working backport for D6 that replicates the D7 version and then think about additional features.
Also, you may want to look at the no anon module. It removes sessions for anonymous users, I believe. As for the has_js, I would argue that it is essential, for D6, to run. Can look at that anyway as a sep. issue.
Thanks for testing.
Comment #34
nickbits commented@budda any chance of having a new D6 branch created using this patch? Can then add extra functions, enhance code, etc. with separate issues rather than one long issue as it now is.
Comment #35
mschudders commentedHi Nickbits,
I am also testing out the patch for D6. (Had to clean out a little bug with the patch ==> it didn't remove the core7.x line.)
but I am facing another problem now.
ReferenceError: jq172 is not defined [http://myproejct/admin/settings/jqmulti:122]/admin/settings/jqmultiCan you tell me what I am missing or doing wrong ?
Thanks
Comment #36
nickbits commentedHi,
Yes it does. Check the diff/patch file, you should see in there somewhere:
I would double check that the patch has been applied correctly.
From #24:
So you don't need jQuery Update.
The jQueryMulti, I never changed any settings from default (don't think I did anyway).
Nick
Comment #37
Anonymous (not verified) commentedI tried following the instructions in #24, and I had some problems. I first tried applying the patch with git-apply, which gave me this error:
But as far as I can tell, it is just trying to delete the cookie_googleanalytics sub-module? Anyway, next I tried with the patch -p1 command, and got this:
Again, no idea why it was failing - the cookiecontrol.info file looked exactly like in the patch file, so I just applied that manually. I also had to delete the auto-generated content at the bottom of that file, which included a line about core=7:
And the output about cookie_googleanalytics.info not being empty was for the same reason, so i just deleted that file.
Anyway, I'm now getting the same as @SleejR - an error in the JS console in Chrome: "Uncaught ReferenceError: jq172 is not defined". I also have jquery_update installed, so maybe this is the problem? Btw if you have it installed when you install jQMulti when you already have jquery_update installed, it says it is not compatible and asks you to update to the latest dev version, which will be why @SleejR said they did that...
Any ideas? I'm happy to provide any more information that would be useful.
Comment #38
nickbits commentedHi,
I will take a look at this today. The ga module should be removed, not had the time to port it. Not sure why ou are getting errors. As for jquery update, I do not have it installed at all, sound like a conflict in one of the modules. Can you just confirm what versions of all he modules you ate using?
Comment #39
nickbits commentedHi All,
First off, let me explain my set-up.
Note I have not changed any default values, that I am aware of and I am NOT using jquery_update (more on that later).
I believe this patch is identical to the previous, but as a few have said they had issues, have re-created it. I have tested the patch and it works fine, or appears to. If you are unsure, this is how to apply the patch:
The patch is NOT production ready, or to the correct coding standard. Partly due to the fact it is unfinished! You may see the following as a result of applying the patch:
The google analytic module is removed, no time to convert yet. Apart from that, it appears to work just fine.
The only issue I have found is that having jquery_update enabled seems to disable jqmulti, or at least block it.
Final note, I do not plan on working on this much, I am using a different module now for my D6 sites.
Regards,
Nick
Comment #40
Anonymous (not verified) commented:) Thanks for your replies. The new patch works! Output:
Then when I enabled the cookiecontrol module, I was getting an alert popup on every page saying "loaded...", and then I tried what @SleejR did and enabled the jQMulti setting "Load this jQuery library even if no libraries or files are assigned to it", and then FINALLY the cookiecontrol module started working properly! Except I now get an alert popup on every page saying "7. jQuery version = 1.7.2" and then "loaded..." but when I comment those lines out in cookiecontrol.module, everything is working great - thanks so much!
Only problem now is the GA submodule... Is there any chance you might have time to look at this at some point? If not, would you have any advice for someone else thinking about porting it to D6?
Thanks again.
EDIT: or just tell us which other module you are using! Does it provide support for GA?
Comment #41
nickbits commentedExcellent. Sorry about the pop ups, that was me doing a bit of debugging. Will re-roll the patch without them in it later today.
I will look at the GA module at the same time, later today. Won't make any promises though.
Comment #42
summit commentedHi, Would love to see a D6 branch arise. Thanks guys!
greetings, Martijn
Comment #43
marco88 commentedHi same here,
I run a Drupal 6.x website targeting UK users.
I really need something like this.
Cheers
Marc.
Comment #44
nickbits commentedHi All,
I too would love to see this committed to a Drupal 6 branch. I no longer have time to work on it, I am using a different module for Drupal 6, and using this one for Drupal 7. Judging by the lack of updates, I expect what is needed is for someone to help co-maintain the module. Unfortunately I have no real time to do that, but the bases for a Drupal 6 branch is there if anyone wants to pick it up and see if they want to maintain it.
Comment #45
summit commentedHi,
Is there at least a winzip version to be made for the drupal 6 version?
Does somebody have it working for Drupal 6?
Please post version here, or PM me.
Thanks a lot in advance,
greetings, Martijn
Comment #46
summit commentedHi, Asking the same question for Drupal 6 again...anyone please? Nobody build the patch to the D6 module?
Thanks a lot in advance.
greetings, Martijn
Comment #47
buddaWould anybody like to co-maintain and sort out the Drupal 6 branch for completeness ?
Comment #48
buddaI don't have any desire to work on Drupal 6 codebase at this moment.