I experienced this problem:
1. basically Splashify works, on every page, redirecting to another page
2. it works if I type the URL to my site in the browser (no referrer)
3. it works if I link to my site from another site (referrer = external)
4. it DOESN'T work if I follow a link to my site through Google !!!
After some debugging I found the reason: the URL that Google generates (which splashify sees as the referrer) roughly has the form of:
http://www.google.com/?[blahblah-google-querystring]&url=http%3A%2F%2Fww...
So the problem is that the function function "i.search(s)", which tests if the referrer contains the site-URL, returns true.
For now I have solved this by trimming the referrer. I have added this bit of code right after the referrer is put in a variable (i):
i = i.substr(0,i.indexOf("?"));
This cuts off anything after (and including) the question mark, which marks the beginning of the querystring.
Comments
Comment #1
Vidioterie CreditAttribution: Vidioterie commentedOops, code above breaks functionality by showing splash-page on every click within the site itself, because there's no check if there's actually a "?" in the code, so if not, it doesn't recognize the referrer at all, because de substr(0,-1) doesn't return anything.
Here's the corrected code (in sites/all/modules/splashify/js/splashify_init_min.js):
(right after:
var i=document.referrer+"";
)if(i.indexOf("?")!=-1) { i = i.substr(0,i.indexOf("?")) }
Comment #2
chrisroane CreditAttribution: chrisroane commentedGood catch! I took your code and modified it to work with the JS, and I think this should be fixed.
Do you have a way of testing this from your end? This updated code is in the 7.x-1.x dev branch. I'm pretty sure this should now be fixed, but it would be great if you could test this from your end.
Sorry for the late response. I'm just getting caught up with the issue queue.
Comment #3
chrisroane CreditAttribution: chrisroane commentedI pushed this changes into the next release of the module: 7.x-1.1. It should show up on the download page soon.
Comment #3.0
chrisroane CreditAttribution: chrisroane commentedadded code-tag around little code bit
Comment #4
dpearcefl CreditAttribution: dpearcefl commentedI'm using the dev code and this issue still happens for me. If I am coming from google, I get html but it renders to a blank white page. If I copy the url into a new browser, it works correctly.
Comment #5
dpearcefl CreditAttribution: dpearcefl commentedIs there any news about getting this fixed?
Comment #6
chrisroane CreditAttribution: chrisroane commentedFrom my testing, it looked like it was working. But I don't have a real case to test with.
I haven't been able to look into this again yet, and the next few weeks look pretty busy for me. There is a chance I may have some time next week to look into it. I'll try to fit it in then.
If you know PHP/JS code, you are sure welcome to take a look. Especially if you have a site where you can replicate this problem.
Comment #7
rwinikates CreditAttribution: rwinikates commentedI am having a hard time reproducing in Chrome on either Mac or Windows, but Firefox (win/mac) and Safari (mac) can reproduce it. Console error shows the following:
ReferenceError: i is not defined @/sites/all/modules/splashify/js/splashify_init_min.js
Comment #8
rwinikates CreditAttribution: rwinikates commentedFurthermore it seems to only affect redirects, not modal windows through colorbox.
Comment #9
chrisroane CreditAttribution: chrisroane commentedAh, that might explain why it worked fine for me in Chrome.
Comment #10
paulkittredge CreditAttribution: paulkittredge commentedI can replicate this problem in Safari on OSX. Here's what I did:
For what it's worth, this is using Splashify version 7.x-1.0 - one version ago. I'm comfortable sharing this URL, since it's degrading somewhat gracefully (showing the home page instead of the splash page, but giving a white screen). I do have another site where I can replicate the issue the original poster mentioned, where the site is on 7.x-1.1 - but I'm not comfortable publicly sharing the URL. Please let me know if you'd like me to pass that along to you, so you can replicate it there.
I mention this in case it's helpful comparing 1.0 to 1.1 and seeing how the changes from 1.0 to 1.1 created the white screen.
Comment #11
Nicolas Bouteille CreditAttribution: Nicolas Bouteille commentedI suspect this could come from Google itself. I have enabled the module on a website that has been live for less than a month and suddenly I get the white screen. I have been forced to disable the splash page for now.
Read this https://drupal.org/node/2104817
What do you guys think ?
Comment #12
chrisroane CreditAttribution: chrisroane commentedThanks everyone for the help in tracking this down!
So I took another look at it and did more testing and found the JS error that was happening. It was actually triggering the JS error in all browsers because there was a bug in the JS. That should now be fixed in the latest code in the dev branch.
Before I push this to 1.2, can someone test the dev branch to see if this problem is resolved? One way that I tested it was manually change the referrer JS variable to use what Vidioterie included above, which will trigger the code we are firing when the link comes from Google.
Nicolas Bouteille: I haven't confirmed if Google is also preventing this from working as well because I don't have a real world example. But the fact that the page is loading a blank page infers that this problem was caused by the JS error that I fixed above. So I'm fairly confident this should fix this issue.
Comment #13
Nicolas Bouteille CreditAttribution: Nicolas Bouteille commentedUpdated to last dev and the white page problem when coming from Google is solved ! Awesome.
Thanks a lot !
Nick
Comment #14
chrisroane CreditAttribution: chrisroane commentedThanks Nicolas for testing this so quickly!
I pushed this to 7.x-1.2. So we should now be set!
Comment #15
chrisroane CreditAttribution: chrisroane commented