Last modified: 2013-01-08 00:17:20 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T36359, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 34359 - SemanticMediaWiki: New page properties: "Last editor is" and "Is a new page".
SemanticMediaWiki: New page properties: "Last editor is" and "Is a new page".
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
Semantic MediaWiki (Other open bugs)
unspecified
All All
: Unprioritized enhancement (vote)
: ---
Assigned To: Jeroen De Dauw
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-02-12 21:22 UTC by Van de Bugger
Modified: 2013-01-08 00:17 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
Implementation. (3.77 KB, patch)
2012-02-12 21:22 UTC, Van de Bugger
Details
Implementation, v2. (3.39 KB, patch)
2012-02-12 22:25 UTC, Van de Bugger
Details
10000! (3 bytes, text/plain)
2012-02-12 22:41 UTC, Jeroen De Dauw
Details

Description Van de Bugger 2012-02-12 21:22:54 UTC
Created attachment 9998 [details]
Implementation.

Please consider a patch. It implements two new special page properties:

* Last editor is -- Page -- the page of the user who made the last hmm... 
* Is a new page  -- Boolean -- true if it is a new page (with just one revision).

I just realized implementation could be a bit incorrect. I may store the person who made the last save, while intention is to store the person who made last revision. I have to recheck it.
Comment 1 Jeroen De Dauw 2012-02-12 21:53:39 UTC
If you save a page without changing anything, no new revision will be created. You'd indeed still have to be careful not to store the user making the save that has no effect.

I'll review & apply your patch when you verified this behavior :)
Comment 2 Van de Bugger 2012-02-12 22:25:15 UTC
Created attachment 9999 [details]
Implementation, v2.

Ok, now it saves the author of the last revision.
Comment 3 Jeroen De Dauw 2012-02-12 22:41:31 UTC
Created attachment 10000 [details]
10000!
Comment 4 Jeroen De Dauw 2012-02-12 22:44:06 UTC
yay - I got attachment 10000 [details] :)

I'll look at your patch now :)
Comment 5 Jeroen De Dauw 2012-02-12 22:50:14 UTC
Patch looks great, applied in r111333. Thanks! :)
Comment 6 Van de Bugger 2012-02-13 15:48:56 UTC
Verified on r111334.
Comment 8 Jeroen De Dauw 2012-02-13 16:12:09 UTC
Great work! :)
Comment 9 Markus Krötzsch 2012-02-13 17:13:15 UTC
The current code does not seem to work quite right. I do not actually get either of the new properties, even after enabling them in LocalSettings. This might be a local issue for me that has other reasons.

However, in addition, it seems that the properties are set to the previous value since they are fetched before storing the (possibly new) page in MediaWiki. So the "last" editor is only the one that was last before saving, i.e., the one before the current one. For new pages, there should never be a value.

Also, it should be checked if the properties are stable when running the SMW_refreshData.php update script (same as using an update job, but easier to target a particular page). It could be that this does not work for '_NEWP'.

Nevertheless, great work, since these new properties will be very useful for maintenance (I imagine using _NEWP and _MDAT to make a list of candidate pages for spam fighting with the Delete Batch extension; many spam bots create pages that are never edited again for a long time).
Comment 10 Van de Bugger 2012-02-13 19:11:40 UTC
> I do not actually get either of the new properties, even after enabling them in LocalSettings.

Did you have a look into documentation? 

> Note: After enabling the property in existing SMW server, do not forget to
> open Special:SMWAdmin page and push Initialize or upgrade tables button. See
> also the help page Repairing SMW's data for further information on this. 

Probably it will help.

> However, in addition, it seems that the properties are set to the previous
> value since they are fetched before storing the (possibly new) page in
> MediaWiki.

Not sure how, but "Is a new page" works for me. I just created a new page and saved it -- "Is a new page" is true. Saving the page again with no changes does not change the property value. Saving a new revision changes the property value to false.
Comment 11 Jeroen De Dauw 2012-02-13 19:53:16 UTC
I made some follow up changes in r111407.

For some reason the "Is a new page" property refuses to show up for me, either as result of a query, on Special:Browse or via the RDF export. The property itself shows on special browse, but the value does not. I tried debugging this and looked at the difference between this property and another one of type boolean. At some point this is done:

$values = $data->getPropertyValues( $diProperty );

For a regular boolean property, $values will be an array with a SMWDIBool (or more, depending on how many you have set). For "Is a new page" the array is empty. So then I dumped the $data object to see what's in there, and the list where getPropertyValues is empty, until after getPropertyValues is called. wtf?? I looked at this for about 10 mins, and all I see is magically appearing data while nothing is modifying the field where it's stored.
Comment 12 Jeroen De Dauw 2013-01-08 00:17:20 UTC
We now have these properties. Since 1.7?

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links