• NextGen Gallery version 3.59.4 threw an error on a page (The Event Calendar) but appears to actually be an incompatibility after turning on my hosting Litespeed Server and cache. The error is:

    “Notice: Undefined property: stdClass::$content in /home/xxxxxxx/public_html/yyyyyyyy.org/wp-content/plugins/nextgen-gallery/src/Util/Router.php on line 595”

    The NextGen code comments actually state that the code has a known bug, but it is too time consuming to fix! Here is your code:

    public function fix_page_parameter() {
    global $post;

        if ( $post
            && is_object( $post )
            && is_string( $post->content )
            && ( strpos( $post->content, '<!--nextpage-->' ) === false )
            && ( strpos( $_SERVER['REQUEST_URI'], '/page/' ) !== false )
            && preg_match( '#/page/(\\d+)#', $_SERVER['REQUEST_URI'], $match ) ) *{
            $_REQUEST['page'] = $match[1];
        }
    }

    Here is my fix:

    public function fix_page_parameter() {
    global $post;

    if ( $post
        && is_object( $post )
        && property_exists($post, 'content')
        && is_string( $post->content )
        && ( strpos( $post->content, '<!--nextpage-->' ) === false )
        && ( strpos( $_SERVER['REQUEST_URI'], '/page/' ) !== false )
        && preg_match( '#/page/(\\d+)#', $_SERVER['REQUEST_URI'], $match ) ) {
        $_REQUEST['page'] = $match[1];
    }

    }

    Please examine for release. Thanks.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Jaime Segura

    (@jaimeimagely)

    Hi @rickwiel

    I am glad to help. I can pass this info to the plugin developers, but I have a couple questions first.

    What do you mean by “on a page (The Event Calendar)” is it related to the plugin called “The Events Calendar”? You also mentioned “my hosting Litespeed Server and cache”, could you please elaborate a bit more on this and also on the issue and describe the scenario and the visible effect?

    If you can send links and or screenshots and any other info that would help. The more details we have, the better, just to reduce the back and forth and present the developers with all they will need to investigate this.

    I will be waiting for your reply.

    Thanks again.

    Thread Starter rickwiel

    (@rickwiel)

    Thanks for looking into this issue.

    I expected the NextGen error to appear on a gallery page, but it did not, it appeared on a page that contains events from The Event Calendar plugin and nowhere else. Unexpected, but maybe a conflict with that plugin? The error listed is literally posted on the top of the page in the content area for all to see.

    The error did not appear until I migrated all of my sites from A2 Drive Hosting to A2 Turbo Hosting which uses LiteSpeed cache and server instead of my prior plugin which was W3 Total Cache.

    I won’t provide snapshots since I don’t want to reintroduce the error. The shock was that the code problem is acknowledged by the developer which had no time to fix, and it has been lying dormant until something triggers it.

    The servers run great, and the error has not reoccurred after my fix.

    Hope that helps,

    Rick

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