• Resolved bravotangodev

    (@bravotangodev)


    As the title says, after using the_flexible, Gravity Forms fails to initialize any form below where the_flexible is used using its normal shortcode. It still outputs the form; however, it doesn’t do it’s normal rendering/loading process – so the form is hidden/unusable.

    I’m not really sure what the_flexible could be doing to cause a conflict here – it seems pretty odd.

    Steps for repro:

    if (has_flexible('layout')) {
    the_flexible('layout');
    }

    Then use a normal ACF field:

    the_field('thing', 'option');

    Which has this:

    [gravityform id="1" title="true"]

    The form will output, but will remain hidden/accessible as it didn’t go through it’s normal initialization process. Changing the order of these things will fix the issue (placing the_field above the_flexible).

    Advanced Custom Fields PRO: Version 6.3.1.2
    Advanced Custom Fields: Extended: Version 0.9.0.5
    WordPress: Version 6.5.4
    Gravity Forms: Version 2.8.12.1

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Konrad Chmielewski

    (@hwk-fr)

    Hello,

    Thanks for the feedback!

    Hmm, this is strange. Do you use any specific Flexible Content advanced settings such as Dynamic Render, which would justify the usage of the_flexible()?

    Behind the scene, the_flexible() is just an alias of have_rows(): the_row(), like the normal ACF loop for Flexible Content (see documentation).

    If you don’t use the Flexible Content Dynamic Render, can you try to use the native have_rows(): the_row()?

    Also, you can try to use do_shortcode('[gravityform id="1" title="true"]') instead of the_field() (which render the shortcode). Maybe the issue come from there?

    I’ll try to run some tests on my side.

    Thanks.

    Regards.

    Thread Starter bravotangodev

    (@bravotangodev)

    Yep, I am using “Dynamic Render” as it’s very useful for my ideal workflow (not needing to specify each template/have assets loaded modularly).

    Using do_shortcode('[gravityform id="1" title="true"]') after the the_flexible still produces the same issue. When using above the the_flexible it works as expected.

    I can confirm using the normal ACF have_rows/the_row method works correctly/as expected. So it seems like it is related to something the_flexible is doing.

    Plugin Author Konrad Chmielewski

    (@hwk-fr)

    Hello,

    Thanks for the details.

    the_flexible() just use have_rows(): the_row() and includes your PHP/JS/CSS files for each layouts.

    Maybe it’s something you’re doing in your PHP/JS Layouts Templates that break Gravity Forms? Did you try to remove all the rows in your Flexible Content, and just keep one, or none at all?

    Does it fix the issue if the Flexible Content is empty, or just has one single simple layout?

    Regards.

    Thread Starter bravotangodev

    (@bravotangodev)

    I have tried the following without any luck:

    1. Removing the template files that it is trying to load (so none of my custom template stuff is loaded).
    2. Removing the dynamic render/preview from the layout.
    3. Removing all layouts/rows on the page.
    4. Added a brand new flexible layout without any fields added.
    5. Removed everything in functions.php.
    Thread Starter bravotangodev

    (@bravotangodev)

    Some additional information here:

    It textdiffed the site with it working/not working and it seems like Gravity Forms fails to load properly is because it is not injecting a lot of its scripts/styles (both inline stuff and enqueued requests) into the website.

    Could the render style.css/script.js fields be messing with this somehow?

    Plugin Author Konrad Chmielewski

    (@hwk-fr)

    Hello,

    Yes, the fact the Gravity form HTML is correctly rendered on screen, but the JS isn’t properly initialized made me believe there was some custom code in your script.js which would break it. Because there is no JS added by ACF Extended at all in there.

    This is why I asked to remove some rows, see if that fixed the issues. By the way, do you see any JS error in your browser console? (F12 on chrome).

    I don’t use Gravity Forms, but I’ll see if I can reproduce the issue.

    Thanks.

    Regards.

    Thread Starter bravotangodev

    (@bravotangodev)

    There are no JS errors in the console and there are no warnings/errors in PHP.

    Something else interesting that I noticed is that using the shortcode within the layouts loaded from the_flexible render/work just fine.

    Plugin Author Konrad Chmielewski

    (@hwk-fr)

    Hello,

    I just ran some tests, and it works fine on my end. Here is the video of my test.

    Can you try to setup a simple test like I did? Try to create a new “Test Field Group”, with a “Test Flexible Content”, and a new simple layout.

    If the problem persists, in order to isolate the issue, I would recommend clone your website on a development / staging environment using Duplicator, or with your hosting backup solution. Then try to disable all your plugins one-by-one (at the exception of ACF Pro, ACF Extended and Gravity Forms) until you find which one cause the issue.

    If the problem persists, try switch to the native WP Twenty Twenty Two theme, to make sure you don’t have any custom code in your theme which would break the feature.

    In all cases you should be able to confirm it works like I did, by setting up a clean WP install with ACF Pro + ACF Extended + Gravity Forms only.

    Let me know if you found something.

    Regards.

Viewing 8 replies - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.