Page MenuHomePhabricator

Make page.page_is_new be = 0 for restored pages with multiple revisions
Open, LowPublic

Description

This column is used to determine whether a page is "new", meaning:

  • It has a single revision, or
  • It's just been undeleted without additional edits

The second part doesn't seem to make much sense, and talking with @daniel we agreed that it looks more like a bug than a feature. Fixing this not only requires a code change, but also a maintenance script to set page_is_new back to 0 for pages with more than one revision.

Event Timeline

The second part doesn't seem to make much sense, and talking with @daniel we agreed that it looks more like a bug than a feature. Fixing this not only requires a code change, but also a maintenance script to set page_is_new back to 0 for pages with more than one revision.

The code change would already help. Fixing bad values in page_is_new is "nice to have" I think: it's not critical that this information be 100% accurate. So as a first step,. we should "stop the bleed".

The second part doesn't seem to make much sense, and talking with @daniel we agreed that it looks more like a bug than a feature. Fixing this not only requires a code change, but also a maintenance script to set page_is_new back to 0 for pages with more than one revision.

The code change would already help. Fixing bad values in page_is_new is "nice to have" I think: it's not critical that this information be 100% accurate. So as a first step,. we should "stop the bleed".

Right. OTOH, I think a maintenance script for this would be quite easy to write. One possibility is the following query:

UPDATE page SET page_is_new = 0 WHERE ( SELECT COUNT(*) FROM revision WHERE rev_page = page_id ) > 1 AND page_is_new = 1

I think running the script is not urgent, but including it in the same patch that fixes the code should be low effort.