Skip to content

ACP "Show like counts" checkbox (rt_show_likes) is saved but never read #197

Description

@avandenberghe

Summary

The ACP "Show like counts" checkbox writes to config['rt_show_likes'] (acp/recenttopics_module.php, $request->variable('rt_show_likes', 0) → $config->set('rt_show_likes', ...), displayed back via RT_SHOW_LIKES), but nothing in core/recenttopics.php ever reads rt_show_likes.

Whether like counts render is decided purely by $this->topic_likes_service !== null (S_POSTLOVE template var, and the guard around get_topic_like_counts()), which reflects only whether the Post Love service is available in the container — not the admin's checkbox. So ticking or unticking "Show like counts" in the ACP has no effect either way: counts show whenever Post Love is installed, and never when it isn't, regardless of this setting.

Location

  • avathar/recenttopics/acp/recenttopics_module.php: saves/reads rt_show_likes (lines ~169-170, ~298), independent of Post Love availability (S_POSTLOVE at line ~300 checks $phpbb_container->has('avathar.postlove.topic_likes'))
  • avathar/recenttopics/core/recenttopics.php: no reference to rt_show_likes anywhere; gating is done solely via $this->topic_likes_service !== null (lines ~445, ~775-777)

Fix

Either gate the like-count display on (bool) $this->config['rt_show_likes'] in addition to the service being available, or remove the dead checkbox from the ACP if like counts should always show whenever Post Love is present.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugv3.0Version 3.0.x - maintenance releases

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions