Priority: Urgent
Current State: Closed
Released In: 1.1.1
Target Release: patch
Applies To: Engine
Component: Foswiki::Meta
Branches:
distro:142fd927aa4a changed the interface to
Foswiki::Meta::getRevisionInfo()
from
getRevisionInfo($fromrev) -> ( $date, $author, $rev, $comment )
... to ...
getRevisionInfo($fromrev) -> \%info
This breaks plugins (e.g.
PublishPlugin) that use
Foswiki::Meta::getRevisionInfo()
.
Foswiki::Func::readTopic
returns a
Foswiki::Meta
object. That object is
not documented as opaque. Rather, the
readTopic
documentation says
This class is fully documented in the source code documentation shipped with the release, or can be inspected in the lib/Foswiki/Meta.pm
file
Thus, I think it is reasonable for
PublishPlugin to use
Foswiki::Meta::getRevisionInfo()
. So, the interface should not have changed in a non-compatible way.
I propose to restore functionality by changing
Foswiki::Meta::getRevisionInfo()
as follows:
Index: Meta.pm
===================================================================
--- Meta.pm (revision 9559)
+++ Meta.pm (working copy)
@@ -1227,6 +1227,11 @@
* ={author}= canonical user ID
* ={version}= the revision number
+---++ ObjectMethod getRevisionInfo() -> ( $revDate, $author, $rev, $comment )
+
+Limited backwards compatibility for plugins that assume the 1.0.x interface
+The comment is *always* blank
+
=cut
sub getRevisionInfo {
@@ -1261,7 +1266,16 @@
# cache the result
$this->setRevisionInfo(%$info);
}
- return $info;
+
+ if (wantarray)
+ {
+ # Backwards compatibility for 1.0.x plugins
+ return ( $info->{date}, $info->{author}, $info->{version}, '' );
+ }
+ else
+ {
+ return $info;
+ }
}
# Determines, and caches, the topic revision info of the base version,
--
MichaelTempest - 14 Oct 2010
Oh, bugger. Yes, your change is good.
--
CrawfordCurrie - 14 Oct 2010