After executing the following line, $user has a cUID rather than login or wikiname.
( $date, $user, $rev, $comment ) = $meta->getRevisionInfo( $rrev );
But TWiki::Render::renderRevisonInfo() is not written that way.
The current code assumes $user has a login or wikiname having the following line.
my $cUID = $users->getCanonicalUserID( $user );
This should be a simple mistake and needs to be corrected.
--
TWiki:Main/HideyoImazu
- 2012-06-21
TWiki:Main.PeterThoeny
pointed out:
Please re-examine this change. Now the code assumes that the user returned from meta data is always CUID, and that the user is known in the password system. This is not always the case:
- $meta->getRevisionInfo() usually returns CUID. But in older TWiki versions, or in data migrated to a TWiki installation, the returned user can be WikiName or login name.
- The $users object only contains users known to the system. That is,
$users->getCanonicalUserID() returns the CUID only for known users. It is common that meta data contains names of deleted users, in which case getCanonicalUserID returns null. So for users unknown to the password system a best effort is done to return the proper user type (CUID, login name, or WikiName) from the meta data.
Now the code accommodates revision data of pre-cUID days.
It checks if the user returned by $meta->getRevisionInfo() is cUID or not by using $users->getLoginName($user).
Only if it's not, $users->getCanonicalUserID($user) is called rather than always.
--
TWiki:Main.HideyoImazu
- 2012-06-22