Jump to content

Two fields, same filtering, same Hanna code, different results?


MarcC
 Share

Recommended Posts

Hi all,

I have some Hanna Code output for PHP Social Stream which is giving different results when the same code is output in two different fields.

Here are the two examples for comparison (Removed as things are working now)

You can see that the page at the second link appears without proper CSS styles, which seems related to the jQuery issue. (Please note that the social feed output itself is not yet fully configured, so the feed in the footer will let you scroll forever, etc.)

The Hanna Code is the same for both, i.e. there is only one test in the Hanna Code PHP right now, to check if the full class for the vendor code has already been include-ed.

Tests are run without caching, and both fields have the same CKEditor filtering, other options, and the same general output logic. Tracy Debugger is active and there are no PHP errors in the logs.

But only one of these fields is giving the correct result.

I did test in other fields (Body for example), and everything works fine there as well.

I thought I'd ask the community for input and would be grateful for any suggestions, thanks for your time.

Link to comment
Share on other sites

In Test A your PHP Social Stream code is loading it's own copy of jQuery. At about line 974 you have:

 <!-- PHP Social Stream By Axent Media -->
<link href="https://www.ncoinc.org/site/templates/social-stream/public/css/colorbox.css" rel="stylesheet" type="text/css" />
<link href="https://www.ncoinc.org/site/templates/social-stream/public/css/styles.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="https://www.ncoinc.org/site/templates/social-stream/public/js/jquery.min.js"></script>

that's as well as the version of jQuery you're loading at the bottom of the page. Obviously it's not good to be loading two versions of jQuery.

In Test B the Hannah code isn't loading its own version of jQuery. I'm guessing the plugin code is looking for the presence of jQuery in the markup and finds it in the second but not the first - perhaps due to the way the page is being built.

The first thing I'd try would be to move loading jQuery into the HEAD section of the site rather than leaving it until last. Techincally that's going to slow down your rendering but means jQuery will be loaded early if you want to add scripts inline.

Of course the best solution is not to use jQuery or include social media widgets ?

 

 

 

  • Like 2
  • Thanks 1
Link to comment
Share on other sites

Ah, so it seems like it may be almost like a race condition with jQuery loading. That's interesting. I'll add that suggestion to my next batch of things to try here, thanks for your input. 

Quote

Of course the best solution is not to use jQuery or include social media widgets ?

? I've given some thought to this kind of thing, and other changes I'd like to make, and I have to say we've come a long way with recent changes already, but I know what you mean there.

Link to comment
Share on other sites

  • 3 weeks later...

Just as an update to this topic, I tried out the jQuery load change and unfortunately it didn't work. However, some of the other ideas I had led to results in working with back-end code, and the test page is working OK now. I still need to run some more tests but thought I'd update the thread while I remember it.

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...