Bug #1429
closedUpdateViews: Duplicate entry bug + error rendering bug
Description
As reported by dansari here:
http://www.joomlapolis.com/component/option,com_joomlaboard/Itemid,38/func,view/id,123549/catid,100
Say jos_comprofiler_views has the following rows:
viewer_id profile_id lastip lastview viewscount vote lastvote
62 261 127.0.0.1 2010-02-02 15:07:34 8 NULL 0000-00-00 00:00:00
62 261 72.137.56.31 2009-02-04 21:42:40 3 NULL 0000-00-00 00:00:00
The UPDATE statement in the recordViewHit function (administrator/components/com_comprofiler/comprofiler.class.php ln 2912) causes the following DB error:
Duplicate entry '62-261-127.0.0.1' for key 1 SQL=UPDATE jos_comprofiler_views
SET viewscount = (viewscount+1),
lastview = NOW,
lastip = '127.0.0.1'
WHERE viewer_id = 62 AND profile_id = 261
It's trying to update both rows to the same lastip value, which would violate the PK.
Related: the javascript popup is missing cleanup for display (see reply).
Files