Don't update categorylinks.cl_timestamp when moving page
Closed, ResolvedPublic

Description

Author: zach+bugs

Description:
When pages are moved, it updates the time stamp on the categorylinks table. Since the category is already added to the page, it should keep the time stamp from when the category was added, not when the page was updated. (By the way, in case you didn't know already, the cl_timestamp provides the "publish date" on the various DynamicPageLists on Wikinews)

Currently, when the category is sorted by a sortkey that is NOT EQUAL to the page's title (or no sortkey is specified in the wikicode, which sorts it by the page's title), it does not update the cl_timestamp value.. so a workaround would be to explicitly specify sorting by something other than the page's title (trim off the last character of the title, random characters, whatever). For example:

Moving a page with [[Category:Foobar|Foobar]] updates cl_timestamp
Moving a page with [[Category:Foobar|Foobaz]] does NOT update cl_timestamp
Moving a page with [[Category:Foobar]] updates cl_timestamp
Moving a page with [[Category:Foobar|]] does NOT update cl_timestamp (Foobar becomes the sort key)
Moving a page with [[Category:Foobar|Foobar.]] does NOT update cl_timestamp

On line 2358 of includes/Title.php, modifying the SQL to set "cl_timestamp=cl_timestamp" will make it not update the timestamp.


Version: 1.12.x
Severity: normal

bzimport added a project: MediaWiki-Database.Via ConduitNov 21 2014, 10:04 PM
bzimport added a subscriber: Unknown Object (MLST).
bzimport set Reference to bz12584.
bzimport created this task.Via LegacyJan 11 2008, 5:26 PM
bzimport added a comment.Via ConduitJan 11 2008, 5:37 PM

zach+bugs wrote:

I must make a correction: Moving a page with [[Category:Foobar|]] DOES update cl_timestamp.

bzimport added a comment.Via ConduitJan 11 2008, 6:07 PM

zach+bugs wrote:

A patch to update the DB query

All this does is add ", cl_timestamp=cl_timestamp" to the query that updates categorylinks on page moves, which causes it to keep the same cl_timestamp

Attached: cl_timestamp-nochangeonmove.diff

brion added a comment.Via ConduitJan 11 2008, 8:56 PM

Done in r29615; I cleaned up the query to use the modern system and added some notes in the comment.

Add Comment