No Code Attached Yet
avatar nielsnuebel
nielsnuebel
12 Feb 2026

Steps to reproduce the issue

  1. Create a banner in com_banners and ensure it is linked to a module or category.
  2. Note the banner ID (e.g., 42).
  3. Set the banner status to "Unpublished" or set a "Finish Publishing" date in the past.
  4. Manually trigger a click by calling the click-routing URL: index.php?option=com_banners&task=click&id=42.
  5. Check the database table #__banners or the statistics table.

Expected result

The click should not be counted because the banner is inactive. The click() method in the model should verify if the banner is currently published and within its publishing date range before incrementing the counter.

Actual result

The clicks counter is incremented regardless of the banner's state or publishing dates. The current implementation of BannerModel::getItem() performs an unconditional update:
$query->select( [ $db->quoteName('a.clickurl'), $db->quoteName('a.cid'), $db->quoteName('a.track_clicks'), $db->quoteName('cl.track_clicks', 'client_track_clicks'), ] ) ->from($db->quoteName('#__banners', 'a')) ->join('LEFT', $db->quoteName('#__banner_clients', 'cl'), $db->quoteName('cl.id') . ' = ' . $db->quoteName('a.cid')) ->where($db->quoteName('a.id') . ' = :id') //state, publish_up, publish_down CHECK MISSING ->bind(':id', $id, ParameterType::INTEGER); // ... missing state and date checks

System information (as much as possible)

Joomla! Version: 5.x (and likely 6.x)
Component: com_banners
Affected File: components/com_banners/src/Model/BannerModel.php

Additional comments

The display of banners (Impressions) correctly respects the state, publish_up, and publish_down fields. However, the click-tracking task is decoupled from these checks.
I am willing to provide a Pull Request that adds a .where($db->quoteName('state') . ' = 1') and potentially date checks to the update query to ensure data integrity in banner statistics.

avatar nielsnuebel nielsnuebel - open - 12 Feb 2026
avatar joomla-cms-bot joomla-cms-bot - change - 12 Feb 2026
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 12 Feb 2026

Add a Comment

Login with GitHub to post a comment