• Resolved tamaya

    (@tamaya)


    Bonjour,
    In Portfolio post i got the following warning instead of the Post-image

    Warning: strpos() expects parameter 1 to be string, array given in /kunden/388885_67227/kcf/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lib/post-thumbnail.php on line 48

    Warning: substr() expects parameter 1 to be string, array given in /kunden/388885_67227/kcf/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lib/post-thumbnail.php on line 68

    $thumbnail_id = get_post_meta($post_id, ‘_thumbnail_id’, true);

    // in the case it’s a ngg image it return ngg-<imageID>
    if ( strpos($thumbnail_id, ‘ngg-‘) === false)
    {
    global $wp_version;

    if (version_compare($wp_version, ‘3.5’, ‘>=’) && $thumbnail_id <= 0)
    {
    $iframe_src = get_upload_iframe_src(‘image’, $post_id);
    $iframe_src = remove_query_arg(‘TB_iframe’, $iframe_src);
    $iframe_src = add_query_arg(‘tab’, ‘nextgen’, $iframe_src);
    $iframe_src = add_query_arg(‘chromeless’, ‘1’, $iframe_src);
    $iframe_src = add_query_arg(‘TB_iframe’, ‘1’, $iframe_src);

    $set_thumbnail_link = ‘<p class=”hide-if-no-js”>%s</p>’;
    $content .= sprintf($set_thumbnail_link, esc_html__( ‘Set NextGEN featured image’, ‘nggallery’ ));
    }

    return $content;
    }

    // cut off the ‘ngg-‘
    $thumbnail_id = substr( $thumbnail_id, 4);

    return $th

    Can you help me?
    Merci!
    Robert

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Contributor photocrati

    (@photocrati)

    @tamaya – Please share a link to where you are seeing this. As it reads now, and from what I am understanding, you are seeing a reference on a front-facing view that is used in the administration pages (specifically as it relates to using the NextGEN Featured Image code).

    Thanks!

    – Cais.

    Thread Starter tamaya

    (@tamaya)

    Hi,
    i see this in the backfront/admin area of wordpress, in different Portfolio post.
    Regards,
    Robert

    Plugin Contributor photocrati

    (@photocrati)

    @tamaya – If this is only appearing in the administration views a link to your domain may still provide some clues in its page source that may provide some ideas for further troubleshooting.

    Thanks!

    – Cais.

    Thread Starter tamaya

    (@tamaya)

    The warning appear in the Backend of WP admin.

    https://snag.gy/FcQq4h.jpg (Warning in different posts in the backend)

    https://snag.gy/zyPtJ5.jpg (post-thumnail.php)

    https://www.kcf1922.de

    Regards,
    Robert

    • This reply was modified 7 years, 11 months ago by tamaya.
    Plugin Contributor photocrati

    (@photocrati)

    Thanks for the screen snippets and the link to your site; it is the screen snippets that have me looking at this …

    We use the following line of code:
    $thumbnail_id = get_post_meta($post_id, '_thumbnail_id', true); (line 45 in post-thumbnail.php)

    This sets the value for $thumbnail_id to be a “string” which goes against the error messages you are seeing/reporting (lines 48 & 68 … as per your screen snippet). We can dig into this further although it could be a conflict being caused from another active plugin or your current theme.

    Have you tried deactivating all of your plugins, clearing your browser cache (and site caches if you are using a caching plugin), then reactivating the NextGEN plugin?

    If this fixes the problem then it was likely one of the deactivated plugins that was causing an issue. Now, retrace your steps activating each plugin and re-checking to see if the problem returns. If it does then that last activated plugin was probably the one. Keep reactivating and in most cases it is also best to keep checking after each plugin, sometimes there may be more than one plugin on a site that will create an issue. If you do find one (or more) plugins causing this problem we would greatly appreciate your feedback on them so the developers may address them as soon as they can.

    Also to note, in rare cases it may be the theme itself that is causing a conflict so while you have just the NextGEN plugin activated you might consider temporarily switching to one of the default WordPress Twenty series themes and see if this corrects the issue as well.

    If the problem still persists after all of this we would still want to know, even more so, as we will still want to sort out the issue and may need additional details.

    Thanks!

    – Cais.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Warning: strpos() expects parameter 1 to be string, array given in’ is closed to new replies.