• Resolved Serge

    (@serge-wp)


    I use WPPA Version 9.0.12.001 and noticed recently that a picture search (using shortcode [wppa type=”search” root=”#165″ landing=”search”][/wppa]) inserts 2 PHP warnings in my my php_errorlog:

    A)
    PHP Warning: Attempt to read property “ID” on null in […]/public_html/wp-includes/link-template.php on line 394

    Using the “Query Monitor” plugin, I see that these are coming from the Component: “Plugin: wp-photo-album-plus”

    and Query Monitor further shows under “Location”:

    wp-includes/link-template.php:394
    get_page_link()
    wp-content/plugins/wp-photo-album-plus/wppa-boxes-html.php:470
    wppa_get_search_html()
    wp-content/plugins/wp-photo-album-plus/wppa-boxes-html.php:438
    wppa_search_box()
    wp-content/plugins/wp-photo-album-plus/wppa-functions.php:542
    wppa_albums()
    wp-content/plugins/wp-photo-album-plus/wppa-filter.php:717
    wppa_shortcodes()
    wp-includes/shortcodes.php:434
    do_shortcode_tag()
    wp-includes/shortcodes.php:434
    preg_replace_callback()
    wp-includes/shortcodes.php:273
    do_shortcode()
    wp-includes/class-wp-hook.php:324
    apply_filters('the_content')
    wp-includes/post-template.php:256
    the_content()
    wp-content/themes/twentyseventeen/template-parts/page/content-page.php:22
    load_template('wp-content/themes/twentyseventeen/template-parts/page/content-page.php')
    wp-includes/template.php:745
    locate_template()
    wp-includes/general-template.php:206
    get_template_part('template-parts/page/content','page')
    wp-content/themes/twentyseventeen/page.php:28

    And -though these may be connected- there’s a second PHP warning whose component is also WPPA:

    B)
    Attempt to read property “ID” on null in […]/public_html/wp-includes/link-template.php on line 409

    with Location details:

    wp-includes/link-template.php:409
    get_page_link()
    wp-content/plugins/wp-photo-album-plus/wppa-boxes-html.php:470
    wppa_get_search_html()
    wp-content/plugins/wp-photo-album-plus/wppa-boxes-html.php:438
    wppa_search_box()
    wp-content/plugins/wp-photo-album-plus/wppa-functions.php:542
    wppa_albums()
    wp-content/plugins/wp-photo-album-plus/wppa-filter.php:717
    wppa_shortcodes()
    wp-includes/shortcodes.php:434
    do_shortcode_tag()
    wp-includes/shortcodes.php:434
    preg_replace_callback()
    wp-includes/shortcodes.php:273
    do_shortcode()
    wp-includes/class-wp-hook.php:324
    apply_filters('the_content')
    wp-includes/post-template.php:256
    the_content()
    wp-content/themes/twentyseventeen/template-parts/page/content-page.php:22
    load_template('wp-content/themes/twentyseventeen/template-parts/page/content-page.php')
    wp-includes/template.php:745
    locate_template()
    wp-includes/general-template.php:206
    get_template_part('template-parts/page/content','page')
    wp-content/themes/twentyseventeen/page.php:28

    Is this something that concerns our beloved developper Opajaap, or more something I can debug myself? (or might even need assistance from my server’s support team?)

    Happy to provide more details if necessary.

    Thanks,
    serge

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Jacob N. Breetvelt

    (@opajaap)

    Make sure the following setting points to an existing page:
    Basic settings -> Search -> I -> Item 1: Search landing page

    Thread Starter Serge

    (@serge-wp)

    I’ve tried hard over the last few days. At first I thought the Polylang app was a hindrance, but even after adding a new [single language] search page and setting the search landing page to that, I still get the errors in link-template.php on line 394.
    Could it be that one or more of my albums is throwing up a NULL id?

    Plugin Author Jacob N. Breetvelt

    (@opajaap)

    Sorry, at last i read your inital post carefully…

    [wppa type=”search” root=”#165″ landing=”search”][/wppa]

    landing=".." should have an integer id of the page not its name.
    So, either find the id of the page you want or (preferrably) leave it out and select the page you want in the settings on

    Basic settings -> Search -> I -> Item 1: Search landing page

    Thread Starter Serge

    (@serge-wp)

    AH! Yes. Thanks very much(!) that does indeed fix that PHP error when I set the “landing page” in the Settings as you describe.

    Even as your “preferrably” option above solved the PHP errors as such, it was still initially a stumbling block, as only having the one single response landing page (in Settings) gave me a 4-search-boxes-in-4-languages puzzle to solve in return.

    I opted for the “find the id of the page” solution by using PHPadmin to sleuthe out the [decimal] page_id’s for each language’s specific search page/post, and thus overruled the “search landing page” by putting landing=“xxxx” into the wppa shortcode.

    Setting Basic settings -> Search -> I -> Item 11: Tagcloud Link to “—the same page—“ (as opposed to auto-created) was also useful.

    Now my only trouble is that the search results all come out in one big chunk (when there are enough results) rather than being paginated, like an album usually is, but -strictly speaking- that’s really another topic and I shouldn’t digress.

    The crux of the matter? SOLVED 🙂
    Many thanks as always!

    Plugin Author Jacob N. Breetvelt

    (@opajaap)

    When you edit the page, you will see the id in the brpwser addessline like
    https://…/wp-admin/post.php?post=5247&action=edit
    thats simpler than using PHPAdmin

    Nevertheless i will add an errormessage in such cases for the future.

    It will read:

    Error in landing page specification. Should be an integer page id or defined by the settings

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Attempt to read property “ID” on null’ is closed to new replies.