This topic has 12 replies, 3 voices, and was last updated 8 years by Radu.

  • Author
  • #139591
     davidryal
    Participant

    Hi- Client noticed recently that Gravity forms-fed frontend editing page had stopped working “at some point recently”

    I isolated the issue to gravity forms choking on something jquery-related, 2 js errors causing some fields not to show. If  I install “scripts-to-footer” plugin but check “load jQuery in header” option, 1 of those 2 errors goes away. I can give admin access to a staging site if necessary, but hopefully this provides some clues?

    I also confirmed that the issue is not present in default themes (not a plugin conflict). I also rescued kleo 4.0.8 off of an older server and installed it — the issue is also not present at that point.

    So it must have been introduced sometime between 4.0.8 and 4.1.5 — any jquery-related changes?

    I would have tested more recent versions as well, but you don’t make them available for download…

    Anyway, thanks for your attention!

    #139757
     Laura
    Moderator

    Hello, will assign the ticket to a higher support level who can help and advise you in your query.
    Thanks! ?

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    Laura Solanes - Graphic Designer and Web Designer

    Please be patient as I try to answer each topic as fast as i can.

    If you like the theme or the support you've received please consider leaving us a review on Themeforest!

    Always happy to help you 🙂

    #139963
     Radu
    Moderator

    Hi,

    I think your plugin register the Js before ours and that can be a cause if it works if you move all scripts to footer, do you have any option in that plugin to load their js in footer?

    Cheers
    R.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #139984
     davidryal
    Participant

    Hi-
    It doesn’t work if all js is moved to the footer, it jsut removes 1 of the 2 js errors. The only thing that works is reverting to the last version of the theme that I have available, 4.0.8 (it may work in some newer versions, but I can’t get ahold of them to try any others).

    #140093
     Radu
    Moderator

    Where i can get the plugin that you are using to test it on my local install ?

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #141294
     davidryal
    Participant
    This reply has been set as private.
    #141440
     Radu
    Moderator

    Hi,

    In the first instance solve this error with this solution :

    COPY CODE
    
    XMLHttpRequest cannot load https://api-iam.intercom.io/vjs/users/ping. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://cabec.staging.wpengine.com' is therefore not allowed access. The response had HTTP status code 500.
    cabec.staging.wpengine.com/:1 Uncaught (in promise) undefined
    

    Possible solution : http://stackoverflow.com/a/12049973

    Do you have some cache plugin ? if yes, de-activate it.

    Do you have activated Combine theme JS files ? from wp-admin -> theme options -> performance & speed, if yes de-activate it, also try to test with PERFORMANCE and SPEED OFF.

    Let me know…

    Cheers
    R.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #141486
     davidryal
    Participant

    Hi Radu-

    I don’t know what the error you mention is (I’ve never seen it), but I’ve disabled the unrelated plugin that was triggering it; this doesn’t not fix the 3 errors I posted here about. The 3 errors that show up in the process I described in my last post are:

    COPY CODE
    Uncaught ReferenceError: gform is not defined
    http://cabec.staging.wpengine.com/admin/cea-lookup/entry/3518/?gvid=2892&page=gf_entries&view=entry&edit=8c0a35ecb0 line 788
    
    Uncaught ReferenceError: gform is not defined
    http://cabec.staging.wpengine.com/wp-content/plugins/gravityforms/js/conditional_logic.min.js?ver=2.0.7 line 1
    
    Uncaught ReferenceError: gformExtractFieldId is not defined
    http://cabec.staging.wpengine.com/wp-content/plugins/gravityforms/js/conditional_logic.min.js?ver=2.0.7 line 1

    I am not using any caching plugins on staging (on production, the host, WP Engine, uses its own, but that is not an issue here — I am working on staging).

    I have toggled and tested with every combination of Kleo speed/dev mode/etc. toggles. The problem is with the theme, because these errors go away when using a default (i.e. 2016) theme & no changes in plugin configuration (all plugins active).

    I am not a developer, but to me this looks like a larger incompatibility with how Kleo loads jquery vs. how Gravity Forms does it. I think these links are more along the lines of the problem/solution:

    http://stackoverflow.com/questions/23786388/js-error-on-gravity-forms — in it, an answer says this:

    COPY CODE
    "I had exactly the same problem, and managed to track it down to some theme code.
    I was using the bones theme, which de-registers the default jQuery JS and adds its own using the Google CDN...
    
    As you can see, it deregister's the default jquery script, and then adds its own cdn-jquery script, which is fine, apart from the fact that the Gravity forms scripts have a dependency on jquery and not cdn-jquery!
    
    Because they can't see the default jquery script, they don't load, and it would seem that they fail silently, simply emitting this JavaScript error because said JavaScript is loaded without checking dependencies.
    
    In any case, I fixed it by re-naming the bones register script to jquery, might not be the best way to fix this, but it works."

    …or maybe this?: http://micahjon.com/loading-jquery-in-the-footer-with-gravity-forms/

    Hope this helps. Thanks for staying on top of it and helping me get it fixed.
    Cheers,
    David

    #141687
     Radu
    Moderator

    Hi,
    Please take a look here : https://drive.google.com/file/d/0Bxo5b6iHWRMwTDN6TXZSNEc4Qm8/view

    I cannot see those errors

    COPY CODE
    
    Uncaught ReferenceError: gform is not defined
    http://cabec.staging.wpengine.com/admin/cea-lookup/entry/3518/?gvid=2892&page=gf_entries&view=entry&edit=8c0a35ecb0 line 788
    
    Uncaught ReferenceError: gform is not defined
    http://cabec.staging.wpengine.com/wp-content/plugins/gravityforms/js/conditional_logic.min.js?ver=2.0.7 line 1
    
    Uncaught ReferenceError: gformExtractFieldId is not defined
    http://cabec.staging.wpengine.com/wp-content/plugins/gravityforms/js/conditional_logic.min.js?ver=2.0.7 line 1
    

    So you are able to use Gravity forms ?

    R.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #141698
     davidryal
    Participant

    Hi Radu-
    If you look at Step 3 above, the 3 js errors how up when you try to EDIT an entry as an admin, like so:

    https://www.opentest.co/share/94f597b09c6211e6b1777d3d580c8a9a

    Once you’ve reproduced that, feel free to switch to a default theme on that site, to verify that all fields show for editing as they should when Kleo is not running.

    …Also, additional clue: running Theme Check on Kleo comes up with the following:

    COPY CODE
    WARNING: Found wp_deregister_script in kleo-framework/options/core/enqueue.php. Themes must not deregister core scripts.
    Line 215: wp_deregister_script( 'jquerySelect2' );

    I’m not 100% sure that a jquery-dependency issue is to blame here, but it sure appears so, given the similarity to the StackOverflow issue I linked above..?

    Thanks again!

    #142230
     Radu
    Moderator

    Please check it now

    Cheers
    R.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #142231
     davidryal
    Participant

    Yes! It looks like it worked! Can you tell me what changes you made, so that I can accomplish the same thing on the client’s live production website?

    Thank you!

    David

    #142304
     Radu
    Moderator

    Just i’ve updated the theme, we have fixed that issue in our current update

    Cheers
    R.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
Viewing 13 posts - 1 through 13 (of 13 total)

The forum ‘Bugs & Issues’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?