Last modified: 2009-11-04 17:18:45 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 T23083, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 21083 - api allusers uses current time for registration if there is a null value in the database
api allusers uses current time for registration if there is a null value in t...
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
API (Other open bugs)
unspecified
All All
: Normal minor (vote)
: ---
Assigned To: Roan Kattouw
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-10-10 15:24 UTC by CBM
Modified: 2009-11-04 17:18 UTC (History)
4 users (show)

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


Attachments

Description CBM 2009-10-10 15:24:08 UTC
Some users have a null value for their user_registration in the user table. 

From enwiki: select user_id, user_name,user_registration from user where user_name='Jclemens';
+---------+-----------+-------------------+
| user_id | user_name | user_registration |
+---------+-----------+-------------------+
|  200029 | Jclemens  | NULL              | 
+---------+-----------+-------------------+

But the API reports the registration time as the current time when the query is run: the query

  http://en.wikipedia.org/w/api.php?action=query&list=allusers&aufrom=Jclemens&auprop=registration

returns: <u name="Jclemens" registration="2009-10-10T15:20:16Z" />

The problem is that the following line in APIQueryAllUsers.php is run regardless whether the user_registration is null, and apparently wfTimestamp defaults to the present time.

   $lastUserData['registration'] = wfTimestamp(TS_ISO_8601, $row->user_registration);
Comment 1 Umherirrender 2009-10-11 07:40:49 UTC
The behaviour of list=users is better:

http://en.wikipedia.org/w/api.php?action=query&list=users&usprop=registration&ususers=Jclemens
Comment 2 Bryan Tong Minh 2009-10-28 22:26:47 UTC
Ideally the backend from users and allusers should be integrated...
Comment 3 Alexandre Emsenhuber [IAlex] 2009-11-04 17:18:45 UTC
Fixed in r58551.

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


Navigation
Links