[wp-meta] [Making WordPress.org] #2710: Forums: "Plugin Contributor" badge is displayed instead of "Plugin Author"
Making WordPress.org
noreply at wordpress.org
Tue Apr 18 10:24:17 UTC 2017
#2710: Forums: "Plugin Contributor" badge is displayed instead of "Plugin Author"
------------------------------+------------------
Reporter: SergeyBiryukov | Owner:
Type: defect | Status: new
Priority: normal | Milestone:
Component: Support Forums | Resolution:
Keywords: has-patch commit |
------------------------------+------------------
Changes (by SergeyBiryukov):
* keywords: => has-patch commit
Comment:
Replying to [comment:3 coffee2code]:
> In the cases mentioned in the ticket, the cache for the authors (when
only the contributor badge was showing as a fallback) or both caches (when
neither badge appeared) had somehow gotten set with an empty array.
Found the culprit: [5287] switched `User_Badges::get_authors()` and
`::get_contributors()` to use the corresponding methods from
`\WordPressdotorg\Forums\(Plugin|Theme)`, but it doesn't account for the
fact that badges are also displayed in some contexts where the plugin or
theme object is not set up:
* When viewing "Plugins and Hacks", "Themes and Template", "Reviews"
forums directly.
* In Spam/Pending/Archived moderator views.
* On a single user's "Replies Created" page.
This causes notices due to `$this->plugin` being empty and pollutes the
cache with an empty array:
{{{
Notice: Trying to get property of non-object in support-forums/inc/class-
directory-compat.php on line 855
Notice: Trying to get property of non-object in support-forums/inc/class-
directory-compat.php on line 889
}}}
On a related note, [5287] references a non-existing
`\WordPressdotorg\Forums\Theme` class for themes, which results in "Theme
Author" badges not being displayed at all, see an
[https://wordpress.org/support/topic/contact-form-issue-after-
update/#post-8822453 example for Stargazer theme].
[attachment:2710.patch] fixes both issues.
--
Ticket URL: <https://meta.trac.wordpress.org/ticket/2710#comment:17>
Making WordPress.org <https://meta.trac.wordpress.org/>
Making WordPress.org
More information about the wp-meta
mailing list