WordPress.org

Ready to get started?Download WordPress

Forums

Comprehensive Google Map Plugin
[resolved] [closed] jquerey error after wordpress 3.6 update (92 posts)

  1. crienoloog
    Member
    Posted 8 months ago #

    Still not working for me...
    Changed all 1.3 to 1.1 and changed all above mentioned fixes...

    OEPS: day later it works all of the sudden !!
    OK solved...

  2. ponderconsulting
    Member
    Posted 8 months ago #

    None of the above suggestions worked for me but installing http://wordpress.org/plugins/jquery-updater/ did.

  3. normanlacy
    Member
    Posted 8 months ago #

    Installing http://wordpress.org/plugins/jquery-updater/ is the answer.

    Thanks ponderconsulting. So easy once you know. I wasted half of my Sunday trying to edit the 1.3 to 1.1!

  4. normanlacy
    Member
    Posted 8 months ago #

    Installing http://wordpress.org/plugins/jquery-updater/ is the answer.

    Thanks ponderconsulting. So easy once you know. I wasted half of my Sunday trying to edit the 1.3 to 1.1!

  5. theshine
    Member
    Posted 8 months ago #

    I tried the other fixes, with the exception of the jquery-updater and things haven't worked so far. What I did was a hack to get rid of the ugly error, but it has not fixed my problem. This will just buy you some time while you search out a real fix:

    Edit the head.php file in the comprehensive google map plugin:
    /wp-content/plugins/comprehensive-google-map-plugin/head.php
    (You can also get there from the plugin editor in the dashboard)

    Comment out all of theses echos:

    echo "<object id='global-data-placeholder' style='background-color:transparent !important;border:none !important;height:0 !important;left:10000000px !important;line-height:0 !important;margin:0 !important;outline:medium none !important;padding:0 !important;position:absolute !important;top:100000px !important;width:0 !important;z-index:9999786 !important'>".PHP_EOL;
    				echo "    <param id='sep' name='sep' value='".CGMP_SEP."' />".PHP_EOL;
    				echo "    <param id='cssHref' name='cssHref' value='".CGMP_PLUGIN_URI."style.css?ver=".CGMP_VERSION."' />".PHP_EOL;
    				echo "    <param id='language' name='language' value='".$cgmp_global_map_language."' />".PHP_EOL;
    				echo "    <param id='customMarkersUri' name='customMarkersUri' value='".CGMP_PLUGIN_IMAGES."/markers/' />".PHP_EOL;
    				echo "    <param id='errors' name='errors' value='".$global_error_messages_json_template."' />".PHP_EOL;
    				echo "    <param id='translations' name='translations' value='".$info_bubble_translated_template."' />".PHP_EOL;
    				echo "</object> ".PHP_EOL;

    That will get rid of the error, but probably won't fix the problem.

  6. theshine
    Member
    Posted 8 months ago #

    This was double posted by wp.org. Please ignore.

  7. theshine
    Member
    Posted 8 months ago #

    This was triple posted by wp.org. Please ignore.

  8. ponderconsulting
    Member
    Posted 8 months ago #

    Good to hear normanlacy, thank you for confirming! I wasted a lot of time on this today as well, grateful to have found a solution.

    theshine - I did that and ended up with an error that said "undefined" - that's when I found http://wordpress.org/plugins/jquery-updater/.

  9. drtonyb
    Member
    Posted 8 months ago #

    I'm a bit puzzled why some people have had so much trouble fixing this jQuery version issue. WordPress 3.6 is loading jQuery version 1.10.2 by default.

    The plugin's jQuery version test needs improving. Converting a version string like 1.10.2 to a floating point number just gives 1.1 which is obviously less than 1.3 and consequently fails the test.

    A better test is testing the string itself. In the file assets/js/cgmp.framework.min.js, I replaced

    m=parseFloat(a.fn.jquery);if(1.3>m)

    with

    if(/1\.[0-2]\.[0-9]{1,2}/.test(a.fn.jquery))

    Note that the letter a in a.fn.jquery might be a different letter in your version - use the same letter as in your version, otherwise the fix won't work.

    Similarly, in the file assets/js/cgmp.framework.js, I replaced

    var version = parseFloat($.fn.jquery);
    if (version < 1.3) {

    with

    if(/1\.[0-2]\.[0-9]{1,2}/.test($.fn.jquery)) {

    Using the jquery-updater plugin fixes the issue because it makes WordPress use jQuery version 2.0.0 (this isn't latest version of jQuery by the way), so the original version test works - 2 < 1.3 is false.

  10. ponderconsulting
    Member
    Posted 8 months ago #

    Good one drtonyb. I uninstalled the plugin and modified assets/js/cgmp.framework.min.js

    m=parseFloat(a.fn.jquery);if(1.3>m)return alert(i.oldJquery),!1;

    to

    parseFloat(a.fn.jquery);if(/1\.[0-2]\.[0-9]{1,2}/.test(a.fn.jquery)>m)return alert(i.oldJquery),!1;

    And it worked perfectly!

  11. drtonyb
    Member
    Posted 8 months ago #

    ponderconsulting,

    The change you say you made isn't quite correct! Should be

    if(/1\.[0-2]\.[0-9]{1,2}/.test(a.fn.jquery))return alert(i.oldJquery),!1;

    not

    parseFloat(a.fn.jquery);if(/1\.[0-2]\.[0-9]{1,2}/.test(a.fn.jquery)>m)return alert(i.oldJquery),!1;

    You can remove m=parseFloat(a.fn.jquery);

    and the test doesn't compare with m

  12. ponderconsulting
    Member
    Posted 8 months ago #

    I was just going to fix that in the post.

  13. asutosh
    Member
    Posted 8 months ago #

    Good one drtonyb. I uninstalled the plugin and modified assets/js/cgmp.framework.min.js

    m=parseFloat(a.fn.jquery);if(1.3>m)return alert(i.oldJquery),!1;

    to

    parseFloat(a.fn.jquery);if(/1\.[0-2]\.[0-9]{1,2}/.test(a.fn.jquery)>m)return alert(i.oldJquery),!1;

    And it worked perfectly!

    but somebody please help me with my banner issue. its also stopped scrolling while upgrading to 3.6. you can check it on http://www.ingeniousdesigns.in

  14. drtonyb
    Member
    Posted 8 months ago #

    asutosh,

    You have made the same mistake as ponderconsulting did. Change

    m=parseFloat(a.fn.jquery);if(1.3>m)return alert(i.oldJquery),!1;

    to

    if(/1\.[0-2]\.[0-9]{1,2}/.test(a.fn.jquery))return alert(i.oldJquery),!1;

  15. ponderconsulting
    Member
    Posted 8 months ago #

    Mistake or no mistake, it works.

  16. drtonyb
    Member
    Posted 8 months ago #

    ponderconsulting,

    Certainly it works with the mistake - it will always work with the mistake, even if you have version 0 or xyz of jQuery!

  17. NickAndy
    Member
    Posted 8 months ago #

    Thanks drtonyb. Working fine on my site. Thanks for the code and the clear directions!

  18. theshine
    Member
    Posted 8 months ago #

    ponderconsulting, not sure why you got that error, possibly you commented out too much. Glad you got it working, I'm going to try the framework.js fix now.

  19. cu3ba11
    Member
    Posted 8 months ago #

    Good one drtonyb. I uninstalled the plugin and modified assets/js/cgmp.framework.min.js

    m=parseFloat(a.fn.jquery);if(1.3>m)return alert(i.oldJquery),!1;

    to

    parseFloat(a.fn.jquery);if(/1\.[0-2]\.[0-9]{1,2}/.test(a.fn.jquery)>m)return alert(i.oldJquery),!1;

    And it worked perfectly!

  20. theshine
    Member
    Posted 8 months ago #

    I've tried all the fixes in this post, but I'm still having trouble with the plugin. Anyone want to look at the <head> on this page for other possible conflicts.
    http://www.culinarybackstreets.com/shanghai/2013/yuyang-laozhen/

    I haven't yet tried to turn off every plugin and then retest. Right now I'm suppressing the error message, but maps still won't load.

    Thanks

  21. drtonyb
    Member
    Posted 8 months ago #

    thesunshine,

    You are loading two versions of jQuery for starters (not a good idea) - version 1.6.4 from google's CDN and 1.10.2 from your local wordpress installation.

    Error in your modification of assets/js/cgmp.framework.min.js

    //if(/1\.[0-2]\.[0-9]{1,2}/.test(a.fn.jquery))

    should be

    if(/1\.[0-2]\.[0-9]{1,2}/.test(a.fn.jquery))

    The // is a comment and removes a lot of code.

  22. theshine
    Member
    Posted 8 months ago #

    drtonyb I commented out the check version line (I added the "//" on purpose) because the code you suggested wasn't working for my install, so I thought I might have some luck with no check version at all. I'm pretty sure 1.64 is coming from a different plugin (that I haven't yet deduced). I was thinking if I had no version checks, the thing might work, but it doesn't. I'll add back the jq version checks, you'll see that it still doesn't work. My next thought was to use a filter to change or remove the call to 1.10.2.

  23. drtonyb
    Member
    Posted 8 months ago #

    sunshine,

    Your comment // in minimised code like this comments out the entire line which removes more code than just one statement.

    I think jQuery 1.6.4 might be coming from your slider plugin

  24. stopczas
    Member
    Posted 8 months ago #

    Thank you Michael from coastlog.net and daviz

    ind the line

    if(1.3>m)return alert(i.oldJquery),!1;

    and change it to:

    if(1.1>m)return alert(i.oldJquery),!1;

    Then open the file assets/js/cgmp.framework.js

    Find

    var version = parseFloat($.fn.jquery);
    if (version < 1.3) {

    and change that to:

    var version = parseFloat($.fn.jquery);
    if (version < 1.1) {

    I did what Michael said, but it still was not working,
    then i changed to 1.1 like daviz wrote

    >Anyway, I'd rather prefer to write
    if (version < 1.3 && version != 1.10)
    instead of downgrade plugin to jquery 1.1

    So those two instruction works perfectly at elkomp-komputery

  25. theshine
    Member
    Posted 8 months ago #

    drtonyb the comment is gone, the map is still not working. The jquery check still fails. The second jquery include in my theme was hard coded into the head, which I also removed, but that breaks the slider and doesn't fix the map. For some people, code like this might work in functions.php (if you don't want to hack the .js files).

    if(!is_admin()){
    	wp_deregister_script('jquery');
    	wp_register_script('jquery', ("https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"), false, '1.8.3');
    	wp_enqueue_script('jquery');
    }

    This will put your jquery back to 1.8.3 which was the version included in WP 3.5.

  26. usacoop
    Member
    Posted 8 months ago #

    Thank you.............. easy to edit. works fine now..

    Quick workaround:

    You need to edit the file assets/js/cgmp.framework.min.js

    Find the line

    if(1.3>m)return alert(i.oldJquery),!1;

    and change it to:

    if(1.1>m)return alert(i.oldJquery),!1;

    Then open the file assets/js/cgmp.framework.js

    Find

    var version = parseFloat($.fn.jquery);
    if (version < 1.3) {

    and change that to:

    var version = parseFloat($.fn.jquery);
    if (version < 1.1) {

    That should do the trick...

    Regards,

    Michael

  27. theshine
    Member
    Posted 8 months ago #

    I tried making the various changes to framework.js code, but the only thing that worked for me was deregistering and reregistering jquery with another version in functions.php. (See my previous response.)

  28. decisive
    Member
    Posted 8 months ago #

    Is this plugin no longer being supported by the author?

    This plugin started showing an annoying popup after the last WP update.

    So I tried to install the JQuery Update plugin. Thant didn't fix anything, so I turned off the Google Map plugin and tried to turn it back on. Now I'm receiving this message...

    Plugin could not be activated because it triggered a fatal error.

    I have tried using the js fix... nope
    I tried reinstalling the original plugin... nope
    I tried turning off JQuery plugin with fresh install of Maps... nope.

    Now I've got tons of pages on my site showing gobbily-gook code. Could really use a fix for this... Think I'll try theshines workaround next.

  29. drtonyb
    Member
    Posted 8 months ago #

    theshine,

    Are you able to put your site back to its state where the only modification is to the version check in assets/js/cgmp.framework.min.js?

    To use any version of jQuery from 1.9.0 onwards you need to include

    <script src="http://code.jquery.com/jquery-migrate-1.2.1.js"></script>

    for the map code to function without errors.

  30. drtonyb
    Member
    Posted 8 months ago #

    decisive,

    Nobody can help if we can't see your site

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic