Support » Plugin: Yet Another Related Posts Plugin (YARPP) » bug fix for role related code.

  • Resolved idpokute

    (@idpokute)


    Hello.
    I’ve met an issue that throws php error. Maybe this is an edge case.

    Here is the file location.
    plugins/yet-another-related-posts-plugin/lib/plugin-deactivation-survey/deactivate-feedback-form.php

    line # 63

    if ( $current_user->roles[0] ) {
    	$role = $current_user->roles[0];
    }
    

    The first item of roles doesn’t use index 0 in some cases. In my case, it is 12. So it should use the first element, not using index 0.

    if ( ! empty( $current_user->roles ) ) {
    	$role = reset( $current_user->roles );
    }
    • This topic was modified 3 months ago by idpokute.
Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Support Michael Nelson

    (@mnelson4)

    Oh thanks for picking up on that @idpokute. Are you using a membership plugin? If so, which? It would help for us to better understand how this warning arises

    idpokute

    (@idpokute)

    Currently the site doesn’t use any membership plugin, but it used(or someone just installed & activated) BBpress if I remember correctly.
    Also The site is using WPFront User Role Editor Business Pro
    Due to its license expired, I can’t reproduce it on a fresh WP site.
    I hope it helps you.

    Plugin Author yarpp

    (@jeffparker)

    Hi @idpokute YARPP v5.8.0 should resolve this. Can you please confirm? Thanks again for reporting the bug πŸ™‚

    https://wordpress.org/plugins/yet-another-related-posts-plugin/#developers

    idpokute

    (@idpokute)

    @jeffparker Sorry for the late response.

    I tested v5.9.0; it still shows the error.

    
    Notice: Undefined offset: 0 in /app/wp-content/plugins/yet-another-related-posts-plugin/lib/plugin-deactivation-survey/deactivate-feedback-form.php on line 63
    
    Notice: Undefined variable: role in /app/wp-content/plugins/yet-another-related-posts-plugin/lib/plugin-deactivation-survey/deactivate-feedback-form.php on line 73
    
    Plugin Support Michael Nelson

    (@mnelson4)

    Thanks for trying it out @idpokute and for sharing the exact warnings you’re getting. But those line numbers match up with YARPP 5.7.0, not 5.8.0. Something happened to the release which made that file not get updated 😩 (it’s updated in Git but not SVN).
    We’ll have to try again…

    idpokute

    (@idpokute)

    No problem. Let me download 5.7.0 from git for testing.
    Can you tell me the github url?

    Plugin Support Michael Nelson

    (@mnelson4)

    Not yet, it’s still a private repo mostly for internal use. I think it will be better to just wait until we release a fix on wp.org

    Plugin Author yarpp

    (@jeffparker)

    @idpokute YARPP v5.10.0 should finally resolve this 🀞🏼 Can you please confirm?

    https://wordpress.org/plugins/yet-another-related-posts-plugin/#developers

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