Disclaimer doesn't show up
I have tried to enable disclaimer with both available modal scripts, the administration part works great, all options work fine, but when I enable module and visit website disclaimer doesn't show (tried also with disabled javascript caching). Does anyone have this module work on drupal 7? It looks like perfect module for me except I can't make it work.
Comments
Comment #1
kmhanser commentedWell unfortunately all I can add to this is a "me too!".
I'm having the exact same problem. Thought disclaimer would be a nice easy way to display a page that the user has to agree to to enter the site, but it's not working.
At first I thought it was related to colorbox. I worked on that for a bit and got colorbox working now (needs newer jQuery, use jQuery-update module), so I don't think that colorbox is the problem now since I can get colorbox to display on other parts of the site.
So maybe me posting on this will make it more active and someone will have a solution?
Or at least a spot where I should start looking / troubleshooting?
any suggestions appreciated!
thx
Comment #2
Marzuk commentedI know this has been open for a while but this functionality was a must have so I was digging around in the code and I think I found two distinct problems:
#1. nyroModal == broken, use jqModal instead
(I didn't investigate nyroModal any closer once I realized that jqModal worked)
#2. This module uses base_path(), which if you do not have a base path set is a problem because the URL that it attempts to load is then http://disclaimer/ instead of http://mysite.com/disclaimer
I've simply opted to hack out the reference to base_path from the module in the function disclaimer_get_js().
Comment #3
mogtofu33 commentedSorry for the delay, in fact 7 release is not functionnal, i don't get time to finish port, i will try to publish a working release in next weeks.
Regards.
Mog.
Comment #4
ghazlewoodI was able to fix the lack of content when using jqModal by including the $base_url into the ajax request, patch attached... Not sure if using the global is best practice, please review
Comment #5
ghazlewood*sigh* re-rolled that earlier patch to correct the quoting of the ajax path
Comment #6
ghazlewoodDon't ask me how but I still had a quoting problem, this finally should be correct, sorry peeps
Comment #7
Anonymous (not verified) commentedThe patch in #6 works good for me on 7
Comment #8
ghazlewoodThanks Steve! :) I've got another patch which moves the cookie check from PHP into JS which improves the module no end as it makes it support boost and caching properly. Will try and re-roll it next week and upload as I'm sure it'd be useful.
Comment #9
Anonymous (not verified) commentedHey George, long time no see!
I stupidly only tried this on a blank D7 install, it doesn't seem to work on the client's site.
From investigation I think it's because there's more than one jquery thingy on the page and this module doesn't seem to use the drupal behaviors & stuff (yes, I'm not that front-endy!).
Does your code fix this at all or do you know why this would be?
Thanks!
Comment #10
ghazlewoodCouldn't say directly but generally speaking check the console for any JS errors. Are you using the age verification bit? I'm not using that so I've not tested it directly in D7.
The only changes I've made to the code which affect the JS functionality are to do with the cookie expiry, there's a deprecated JS function in use (toGMTString which has been replaced with toUTCString) but that is only triggered if you're setting a non-default disclaimer_cookie_expires variable as I am.
Whole swathes of this module could probably be re-written now as various bits are out of date with D7.
Attached is a patch against 7.x-1.x-dev which includes all the tweaks I've made to date if that's any use...
Comment #11
Anonymous (not verified) commentedAh cool thanks, I'll check it out & update when find out more...
Comment #12
kmare commentedghazlewood,
thank you! dev version + your patch looks like worked like a charm for me. How about releasing an official dev version for drupal 7?
Thank you again
Comment #13
mogtofu33 commentedThanks for the patch, i finally get some time to release a real 7.x version of this module, please check the new dev release and give feedback.
Comment #14
webdevjay commentedI have installed the disclaimer and colorbox module and have configured them as well but still the disclaimer does not show up.
I tried patching it with the latest patch posted by you but it is giving me the following error
$ git apply -v disclaimer-7.x-1.x-dev-2012-10-15-001.patch
Checking patch disclaimer.js...
error: while searching for:
/**
* @name disclaimer module js file
*/
function WriteCookie(nom, valeur){
var cookie_path = Drupal.settings.disclaimer.cookie_path;
var cookie_expires = Drupal.settings.disclaimer.cookie_expires;
var cookie_domain = Drupal.settings.disclaimer.cookie_domain;
error: patch failed: disclaimer.js:1
error: disclaimer.js: patch does not apply
Checking patch disclaimer.module...
error: while searching for:
*/
function disclaimer_init() {
if (disclaimer_show()) {
// add modal library
drupal_add_library('disclaimer', variable_get('disclaimer_modal', 'nyroModal
'));
// cookie settings
error: patch failed: disclaimer.module:44
error: disclaimer.module: patch does not apply
Comment #15
mogtofu33 commentedLast dev version do not need this patch.