From: Joey Hess Date: Tue, 29 Sep 2009 17:35:41 +0000 (-0400) Subject: Merge commit 'origin/master' X-Git-Url: https://sipb.mit.edu/gitweb.cgi/ikiwiki.git/commitdiff_plain/4d9976060be0a0f84120d9edfc8966dc986f2b55?hp=9bea3db4f37a934846cf8d3ac9f57a615bdad422 Merge commit 'origin/master' --- diff --git a/IkiWiki/Plugin/external.pm b/IkiWiki/Plugin/external.pm index 0d292dfc2..ec91c79db 100644 --- a/IkiWiki/Plugin/external.pm +++ b/IkiWiki/Plugin/external.pm @@ -8,7 +8,6 @@ use warnings; use strict; use IkiWiki 3.00; use RPC::XML; -use RPC::XML::Parser; use IPC::Open2; use IO::Handle; @@ -55,7 +54,19 @@ sub rpc_call ($$;@) { $plugin->{accum}.=$_; while ($plugin->{accum} =~ /^\s*(<\?xml\s.*?<\/(?:methodCall|methodResponse)>)\n(.*)/s) { $plugin->{accum}=$2; - my $r = RPC::XML::Parser->new->parse($1); + my $parser; + eval q{ + use RPC::XML::ParserFactory; + $parser = RPC::XML::ParserFactory->new; + }; + if ($@) { + # old interface + eval q{ + use RPC::XML::Parser; + $parser = RPC::XML::Parser->new; + }; + } + my $r=$parser->parse($1); error("XML RPC parser failure: $r") unless ref $r; if ($r->isa('RPC::XML::response')) { my $value=$r->value; @@ -72,9 +83,9 @@ sub rpc_call ($$;@) { # XML-RPC v1 does not allow for # nil/null/None/undef values to be - # transmitted, so until - # XML::RPC::Parser honours v2 - # (), external plugins send + # transmitted. The extension + # is the right fix, but for + # back-compat, let external plugins send # a hash with one key "null" pointing # to an empty string. if (exists $hash{null} && diff --git a/IkiWiki/Plugin/parentlinks.pm b/IkiWiki/Plugin/parentlinks.pm index b01d76f80..e678a057d 100644 --- a/IkiWiki/Plugin/parentlinks.pm +++ b/IkiWiki/Plugin/parentlinks.pm @@ -57,7 +57,7 @@ sub pagetemplate (@) { if ($template->query(name => "parentlinks") || $template->query(name => "has_parentlinks")) { - my @links=[parentlinks($page)]; + my @links=parentlinks($page); $template->param(parentlinks => \@links); $template->param(has_parentlinks => (@links > 0)); } diff --git a/debian/changelog b/debian/changelog index b368618b4..b948aaf56 100644 --- a/debian/changelog +++ b/debian/changelog @@ -6,6 +6,7 @@ ikiwiki (3.14159266) UNRELEASED; urgency=low * img: Fix dependency code for full size images. * toggle, relativedate: Support templates that add attributes to the body tag. + * Support RPC::XML 0.69's incompatable object instantiation method. -- Joey Hess Sun, 27 Sep 2009 17:40:03 -0400 diff --git a/plugins/externaldemo b/plugins/externaldemo index be7aba8b9..24861dcc9 100755 --- a/plugins/externaldemo +++ b/plugins/externaldemo @@ -8,7 +8,6 @@ use strict; print STDERR "externaldemo plugin running as pid $$\n"; use RPC::XML; -use RPC::XML::Parser; use IO::Handle; # autoflush stdout @@ -31,7 +30,19 @@ sub rpc_read { $accum=$2; # the rest # Now parse the XML RPC. - my $r = RPC::XML::Parser->new->parse($1); + my $parser; + eval q{ + use RPC::XML::ParserFactory; + $parser = RPC::XML::ParserFactory->new; + }; + if ($@) { + # old interface + eval q{ + use RPC::XML::Parser; + $parser = RPC::XML::Parser->new; + }; + } + my $r=$parser->parse($1); if (! ref $r) { die "error: XML RPC parse failure $r"; }