Item1884: OP_ref broken on trunk (patch available)
Priority: Urgent
Current State: Closed
Released In:
Target Release: n/a
Applies To: Engine
Component:
Branches:
Test (taken from the docu):
You type:
%IF{"'%SYSTEMWEB%.WebHome'/lc(text)~'*welcome*'" then="contains 'welcome'" else="woops"}%
You get (works here):
contains 'welcome'
But on trunk it's
woops
... which is wrong.
Here's the patch... not sure if that's correct. Crawford can you check, please?
--- OP_ref.pm (revision 4593)
+++ OP_ref.pm (working copy)
@@ -40,10 +40,8 @@
my ( $w, $t ) =
$Foswiki::Plugins::SESSION->normalizeWebTopicName(
$Foswiki::Plugins::SESSION->{webName}, $v );
- my $result = undef;
try {
- my $submeta = $Foswiki::cfg{RCS}{QueryAlgorithm}->getRefTopic(
- $domain{tom}, $w, $t );
+ my $submeta = Foswiki::Meta->load($Foswiki::Plugins::SESSION, $w, $t );
my $b = $pnode->{params}[1];
my $res = $b->evaluate( tom => $submeta, data => $submeta );
if ( ref($res) eq 'ARRAY' ) {
--
MichaelDaum - 04 Aug 2009
No, it's not correct because it blows away the refactoring I did to decouple the query engine from the store engine. I will investigate further.
--
CrawfordCurrie - 05 Aug 2009
There was a missing require.
--
CrawfordCurrie - 05 Aug 2009
If I may be picky, why do you eval then die:
+ eval "require $Foswiki::cfg{RCS}{QueryAlgorithm}";
+ die $@ if $@;
If I'm not mistaken, this does exactly the same as:
+ require $Foswiki::cfg{RCS}{QueryAlgorithm};
Innit?
--
OlivierRaginel - 05 Aug 2009
@Olivier:
From
perldoc -f require:
require EXPR
If EXPR is a bareword, the require assumes a ".pm" extension and replaces "::" with "/" in the filename for you, to make it easy to load standard modules.
eval "require $var"
is needed if $var may be a package name.
--
MichaelTempest - 08 Aug 2009