Project

General

Profile

Actions

Bug #1429

closed

UpdateViews: Duplicate entry bug + error rendering bug

Added by beat almost 15 years ago. Updated almost 15 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
Start date:
04 February 2010
Due date:
% Done:

100%

Estimated time:
0:18 h

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

1429.patch (5.55 KB) 1429.patch krileon, 04 February 2010 20:35
1429-beat.patch (6.09 KB) 1429-beat.patch beat, 21 February 2010 19:19
Actions

Also available in: Atom PDF