phplist

NOTE:: Before reporting an issue, make sure you are running the latest version, currently 3.3.1


View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0017031phplist applicationClick Trackingpublic23-01-14 08:4701-02-14 02:05
Reporterduncanc 
PrioritynormalSeveritymajorReproducibilitysometimes
StatusresolvedResolutionfixed 
PlatformOSOS Version
Product Version3.0.5 
Target Version3.0.6Fixed in Version3.0.6 
Summary0017031: Reset click statistics deletes links used by other messages
DescriptionThe final tab when composing a message has a checkbox to 'reset click statistics'.

The processing when that is checked is incorrect and will incorrectly delete rows from the linktrack_forward table causing 404/page not found errors when a link of the same url in a different message is clicked.

See function resetMessageStatistics() in file lib.php.
This processing will delete rows from linktrack_forward whose url has been clicked, even when that url is used by another message.
Rows in this table do not relate to messages, so the check of $count[0] < 2 is wrong.
I don't see why rows in linktrack_forward need to be deleted, even if the row is used only by one message, as new rows for the same urls will be created when the message is built.
The code should probably be removing rows from linktrack_ml instead.

The processing may well be as simple as deleting rows from linktrack_ml and from linktrack_uml_click for the given message id.

As this problem causes confusion for subscribers, I have had reports of "page not found" when clicking a link, can it be fixed in the upcoming release?

  $delete = array();
  $req = Sql_Query(sprintf('select forwardid from %s where messageid = %d',$GLOBALS['tables']['linktrack_uml_click'],$messageid));
  while ($fwdid = Sql_Fetch_Row($req)) {
    $count = Sql_Fetch_Row_Query(sprintf('select count(*) from %s where id = %d',$GLOBALS['tables']['linktrack_forward'],$fwdid[0]));
    if ($count[0] < 2) {
      $delete[] = $fwdid[0];
    }
  }
  if (sizeof($delete)) {
    Sql_Query(sprintf('delete from %s where id in (%s)',$GLOBALS['tables']['linktrack_forward'],join(',',$delete)));
  }
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]

-  Notes
(0052629)
michiel (manager)
23-01-14 12:54

yes, that is serious.
(0052661)
duncanc (developer)
25-01-14 13:59

See GitHub pull request https://github.com/michield/phplist/pull/20 [^]
(0052791)
michiel (manager)
01-02-14 02:05

r4315


Copyright © 2000 - 2017 MantisBT Team
Powered by Mantis Bugtracker