On a certain page, we had two XHTML validation errors. We enabled this module, and end up with 204 validation errors.

The validator seems to be nitpicking the URL syntax of the site this module links to, so I am not sure if there is anything that can be done about the errors. Could you be so kind as to take a look at what we are seeing? I validated this page:
http://christians-in-recovery.org/Resources_BibleStudies_BeginnersGuide

And I was using this to validate:
http://validator.w3.org/

Thus this is the direct link to the validator results:
http://validator.w3.org/check?uri=http%3A%2F%2Fchristians-in-recovery.or...

Thank you so much!

Comments

bbodenmiller’s picture

That page has no links to scriptures.

mdlueck’s picture

I apologize, that page seemed to have been marked "Premium". I took that flag off for now. Later we can decide if that document is really Premium or not.

Please try the link again. Thank you!

bbodenmiller’s picture

Version: 5.x-1.1 » 6.x-1.0
Category: support » bug
Status: Active » Needs review

Here is the patch code for the 6.x-1.0 version. It is probably the same for the 5 version.

Notice & changed to & in URLs:

switch ($translation) {
case 'ESV':
// note: the ESV could actually support a mouseover reference
// we could pull it directly from their site and include it in the $title text
// http://www.gnpcb.org/esv/share/services/api/ for more info
$link = 'http://www.gnpcb.org/esv/search/?go=Go&q=';
$title = 'English Standard Version Bible';
$link = sprintf('%s',$link,htmlentities(urlencode(trim("$volume $book $verse"))),$title,trim($reference));
break;
case 'NET':
$link = 'http://net.bible.org/passage.php?passage=';
$title = 'New English Translation';
$link = sprintf('%s',$link,htmlentities(urlencode(trim("$volume $book $verse"))),$title,trim($reference));
break;
case 'TNIV':
$link = 'http://www.tniv.info/bible/passagesearch.php?passage_request=';
$title = 'Today\'s New International Version';
$link = sprintf('%s',$link,htmlentities(urlencode(trim("$volume $book $verse"))),$title,trim($reference));
break;
default:
$link = "http://biblegateway.com/cgi-bin/bible?language=english&version=$translation&passage=";
$title = 'Bible Gateway';
$link = sprintf('%s',$link,htmlentities(urlencode(trim("$volume $book $verse"))),$title,trim($reference));
break;
}

mdlueck’s picture

bbodenmiller: Pasting in your code to the .inc file and commenting out the original portion - yuck! Shows up as bare text URL's. Testing on the 5.x-1.1 version.

jamesoakley’s picture

Version: 6.x-1.0 » 7.x-1.x-dev
Status: Needs review » Needs work

I've been able to reproduce this - the problem is that the anchor tags contain href attributes with '&' in, instead of '&'.

Flagged as 7.x, as all bug reports / new features are being developed against the 7.x version of the module for the time being (which does not stop those patches being rerolled against 6.x subsequently).

If someone wants to submit a proper patch file to fix this, they'd be very welcome!

jamesoakley’s picture

Status: Needs work » Active
jamesoakley’s picture

Status: Active » Needs review
StatusFileSize
new1.97 KB

I think the attached solves it. If someone wants to test it, that would be a help.

mdlueck’s picture

Looks like a fairly simple diff. The one site we use this mod on is still on D6. Any idea if the diff is safe to apply to the D6 version?

jamesoakley’s picture

StatusFileSize
new2.09 KB

The attached should work for Drupal 6.

If you could test this one and confirm it works for Drupal 6, that would be half the testing done.

mdlueck’s picture

Very odd... applying the patch makes no difference in the Validator gripe count!

URL
http://validator.w3.org/check?uri=http%3A%2F%2Fchristians-in-recovery.or...

Pre
262 Errors, 234 warning(s)

Post
262 Errors, 234 warning(s)

FYI: Did a bit of clean up on that page since these counts, so visiting the URL now will deliver different numbers. That does not change the fact that the patch does not appear to have fixed any gripes.

jamesoakley’s picture

Thanks for testing.

Did you clear the Drupal cache before re-running the test?

Given there are quite a lot of errors / warnings on there that do not relate to Scripture Filter, we need to find out what errors are being caused by this module.

Could you try disabling the Scripture Filter module entirely, clear the Drupal cache, and run the test. Leave the result open, and open a new browser window / tab. Then re-enable the Module, clear the Drupal cache again, and use that new tab to re-run the test. You then have two windows with validation test results open side-by-side, the only difference being that Scripture Filter was being used for one and not for the other.

1. How many additional errors is this module causing?

2. Can you find those additional lines, and post exactly what the W3C validator is complaining about.

Once we know precisely what the reported problem is, we can work to fix it equally precisely.

mdlueck’s picture

Status: Fixed » Needs review

Actually I retested again, and now do not see complaints about Scripture Filter!

All caching is disabled, in Admin \ Site configuration \ Performance.

I have no idea what was up with the same error count before/after applying the patch.

Most errors were for an old script to randomly highlight site content. (P.S. I found how to properly wrap JavaScript within XHTML http://javascript.about.com/library/blxhtml.htm and even that block was able to be re-enabled without sending the grip count through the roof.) I turned that block off and the complaint list dropped to:

55 Errors, 20 warning(s)

and like I said, none that Scripture Filter caused. I guess your fix really did make a positive difference. Thank you! :-)

jamesoakley’s picture

Status: Needs review » Fixed

Committed

Watchkeeper’s picture

Status: Needs review » Fixed

I can confirm that the patch has worked on our Drupal 6 installation. We now have a clean bill of health with the W3C code validator. Thank you very much!

Our site is bcconline.org.uk.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.