• Resolved JST

    (@jstav)


    Accessing buddypress Member pages throws warnings about TSF’s post-data.class.php file.

    go to Buddypress
    list all members page
    click any username
    see warnings
    expected to see no php warning on post type that buddypress uses for its member pages.
    well, these should all be excluded from any seo/robots/sitemap anyway, for privacy, but that’s not directly related to the scope of this project.

    warning code:
    Warning: array_intersect_key(): Expected parameter 1 to be an array, bool given in //public/wp-content/plugins/autodescription/inc/classes/post-data.class.php on line 115

    Warning: Invalid argument supplied for foreach() in //public/wp-content/plugins/autodescription/inc/classes/post-data.class.php on line 120

    Warning: array_merge(): Expected parameter 2 to be an array, null given in //public/wp-content/plugins/autodescription/inc/classes/post-data.class.php on line 124

    disabled all wordpress plugins, set theme to twenty nineteen, same issues apply.
    the 3 warnings are repeated over and over on those pages, listed almost 30 times.
    otherwise, functionality.
    also tried rolling back buddypress to 4.4.0 , no good. not sure where this is coming from.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Sybre Waaijer

    (@cybr)

    Hello!

    I explained this issue here, and it boils down to that something’s actively breaking the WordPress API; changing variable types.

    When that happens, the system can’t cache the results (because they’re undefined), and that’s why you see the error many times.

    I’m glad you found that it is merely a BuddyPress-related issue. Thank you for your time to investigate! I’ll see if I can forward this issue to the right people.

    Cheers ??

    Thread Starter JST

    (@jstav)

    appreciate the quick response. you’ve proven time and time again that you stand behind your code and try to improve it rather than stuff it with bloat, useless features and FUD.

    I wish this plugin was more compatible with my setup, as it seems I’m on one of those edge cases, even though my setup is basic and standard, something must’ve gone wrong down the line.

    I rolled back to 3.2.4 and it’s fine. I’ll stick with it as much as I can, but seems like I’m going to have to switch to another plugin :'(

    Nevertheless, thanks for the ongoing support.

    • This reply was modified 5 years, 5 months ago by JST.
    Plugin Author Sybre Waaijer

    (@cybr)

    Hello!

    I did more digging, and the issue boils down to this:

    1. BuddyPress creates membership pages, assigns them as “WordPress pages,” but gives them no “page ID”.
    2. Without an ID, the post-getting mechanism of WordPress doesn’t fail, for some bizarre reason.
    3. Because we get a valid, albeit non-existing post object, any subsequent requests with that post object will lead to unexpected behavior.

    So, it’s simple: Instead of relying on WordPress for handing us valid post objects, we test the post object a little more intimately.

    If we change one check from:
    if ( ! $post )
    to:
    if ( empty( $post->ID ) )

    …the issue is gone ??

    There’s even more good news: I found that when utilizing this trick, we could automatically add invalid-query-detection support, which very much eliminates all compatibility issues caused by “not-really-WordPress” solutions. So, for example, your titles are also correct again, without having to intervene.

    So, I must concede on some of my previous statements, but the fact remains that BuddyPress (and others, like Events Calendar) do things outside of expected API behavior, giving us mixed and unexpected signals.

    Expect a fix for the next update. Cheers!

    Plugin Author Sybre Waaijer

    (@cybr)

    TSF v4.0.2 has just been released, and in that, I addressed this issue ?? Cheers!

    Thread Starter JST

    (@jstav)

    Saw this just now.
    Amazing work! Thank you for the ongoing support.
    I will test it and report back ??

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘buddypress 5.0, php warnings referring to TSF post-data.class.php on member page’ is closed to new replies.