• Resolved pattyok

    (@pattyok)


    The Parent Page Dropdown went missing on my site recently and Ive narrowed the problem down to this plugin.

    When Gallery Custom Links is active and a page has a gallery with a custom link applied, the response from the wp-json request that is used to populate the Parent Pages dropdown (https://test-clean-site.local/wp-json/wp/v2/pages?per_page=100&exclude=29&parent_exclude=29&orderby=menu_order&order=asc) has json errors. All links are not encoded correctly, resulting in invalid JSON, resulting in a javascript error, resulting in a missing Parent Page Dropdown…

    Tested on a clean install, with no other plugins active except this on, WP 5.2.2

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Jordy Meow

    (@tigroumeow)

    Can you edit the mgcl_core.php file and change this line:

    public $isObMode = true;

    to this?

    public $isObMode = false;

    Thread Starter pattyok

    (@pattyok)

    Doing that causes the response from the wp-json request to be null…

    Thread Starter pattyok

    (@pattyok)

    This is still an issue for me, any other thoughts on a fix?

    Plugin Author Jordy Meow

    (@tigroumeow)

    Hi,

    Sorry, I don’t really know how to fix this ?? The plugin works perfectly but if there is an HTML issue in your page, it might indeed break parts of it. That is caused by the HTML DOM Parser. Unfortunately, there is no way around it right now, you could change in the (mgcl_core.php file) this:

    public $parsingEngine = 'HtmlDomParser';

    to this:

    public $parsingEngine = 'DiDom';

    But HtmlDomParser is already the “kindest” DOM Parser. DiDom is better and faster but might break your website completely if the HTML is not valid. Please try, with a bit of luck it will work.

    If I have time, I might develop a Javascript version of the plugin so that it works better on websites which has HTML issues.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Custom Links result in invalid JSON from wp-json request’ is closed to new replies.