Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • #1054185

    Compare REST API URLs:
    Classic Editor Post – https://wels.net/?rest_route=/wp/v2/dev-daily
    Advanced Layout Builder Post – https://wels.net/?rest_route=/wp/v2/bible3

    This happened after Enfold Update 4.5.2
    The RSS feed shows the content:
    https://wels.net/category/bible3/feed/

    It appears that as soon as the REST API discovers ALB it bombs. How can this be fixed to work again?
    Our Mobile App can’t load content because of this REST Api issue.

    • This topic was modified 5 years, 11 months ago by welswebmaster. Reason: Wrong technical term
    #1056949

    Hey Julie,

    That happens because we are loading the shortodes…
    The best would be to have different pages who are only for the mobile application and they do not load ALB at all…

    Best regards,
    Basilis

    #1057430

    Hey Basilis,
    Interesting response in that ALB shortcodes is the cause, but no plans to rectify it other than force the user to recreate content?

    #1058958

    Hi,

    You can take a look here
    https://github.com/WP-API/WP-API/issues/2962

    if that is something to help you out.

    Best regards,
    Basilis

    #1060438

    Hi there,

    I think we are facing the same problem.
    After switching from WordPress 4.9.9 to WordPress 5.0.3 (both using the same Enfold version 4.5.2) the WP-API doesn’t deliver the rendered HTML content anymore. This only happens while using the ALB and does affect both posts and pages.

    Example API response using WP 4.9.9


    “content”: {
    “rendered”: “<div class=\”flex_column av_one_full flex_column_div av-zero-column-padding first \” style=’border-radius:0px; ‘> …”
    }

    Example API response using WP 5.0.3


    “content”: {
    “rendered”: “</p>\n”
    }

    Any suggestions on this or the underlying cause of it?
    Thanks in advance.

    #1062712

    Hi,

    Thank you for reporting this – and sorry for the problems.

    I opened a bug issue for that in our dev repo.

    Cause is, that Gutenberg saves changes via REST API calls. We probably missed to create output of ALB content on regular calls.
    We try to fix it asap.

    Best regards,
    Günter

    #1062714

    Günter vielen Dank

    #1063237

    Hi,

    I’ve found a possible solution. Can you please replace

    enfold\config-templatebuilder\avia-template-builder\php\shortcode-template.class.php

    with this file:

    https://github.com/KriesiMedia/enfold-library/blob/master/temp_fixes/Enfold_4_5_3/shortcode-template.class.php

    Do not forget to make a backup of the original file for a fallback.

    The changes can be found in function shortcode_handler_prepare line 315 ff.

    I asked Kriesi to recheck that these changes do not have a negative impact – if not it will become part of the core.

    Best regards,
    Günter

    #1063253

    Günter
    Looks like content section is still missing data. Title and excerpt are good.
    Since the site was not affected (crashed) – I’ll leave it for you to see. Take a look: https://wels.net/?rest_route=/wp/v2/bible3
    Thanks for your continued support.
    j

    #1063629

    Hi,

    Thanks for the feedback.

    Seems that WP must have changed something in the REST API with 5.0.

    I uploaded a new fix at https://github.com/KriesiMedia/enfold-library/blob/master/temp_fixes/Enfold_4_5_3/shortcode-template.class.php
    that works on my dev server.

    Changes can be found in function shortcode_handler_prepare line 315 ff.

    Can you please check if they work for you also.

    Best regards,
    Günter

    #1063649

    Hello Günter,

    thank you for the response and support.
    I tried your last fix and it seems to work as expected. The “rendered” part now holds the content again.
    If I notice any inconsistencies I will post again. For now everything seems fine.

    Best regards

    #1063661

    Close! While the JSON looks good now (thank you), the GraphQL is still not working.

    GOOD – https://wels.net/wp-content/uploads/kriesi/JSON.jpg
    BAD – https://wels.net/wp-content/uploads/kriesi/GRAPHQL.jpg

    So, our mobile app has mixed results with the GraphQL not working with ALB content. I’ve reverted to the original since the majority of our mobile app pulls via GraphQL.
    j

    #1063670

    Hi,

    Can you try to replace (around line 353)

    
    if( defined( 'REST_REQUEST' ) && REST_REQUEST && ( $post instanceof WP_Post ) )
    

    with

    
    if( $post instanceof WP_Post )
    

    I uploaded the changed file.

    Best regards,
    Günter

    #1063675

    Yeah! We have a complete solution, Günter. Thank you so much. All is GOOD.
    Enjoy your day. Close this ticket as resolved.

    #1063689

    Hi,

    Glad we could help you and thanks for your assistance also.

    Enjoy the theme and have a nice day.
    Feel free to come back if you need further assistance.

    Best regards,
    Günter

Viewing 15 posts - 1 through 15 (of 15 total)
  • The topic ‘REST API missing content after title if using ALB in a POST’ is closed to new replies.