Skip to content

Commit

Permalink
Item9971: Once again, || ruined the day. If you put "" as a search st…
Browse files Browse the repository at this point in the history
…ring, it evaluates as "", therefore || strikes in, and it is replaced by 0. With this fix, you get ALL topics from a web, not just the ones with the field you want. Stay tuned for next fix

git-svn-id: http://svn.foswiki.org/trunk@9898 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
OlivierRaginel authored and OlivierRaginel committed Nov 7, 2010
1 parent 2e3103b commit e32de23
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion core/lib/Foswiki/Query/Node.pm
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ use constant MONITOR_EVAL => 0;
sub toString {
my ($a) = @_;
return 'undef' unless defined($a);
if ( UNIVERSAL::isa( $a, 'Foswiki::Query::Node' ) ) {
return '{ op => ' . $a->{op} . ', params => ' . toString( $a->{params}
) . ' }';
}
if ( ref($a) eq 'ARRAY' ) {
return '[' . join( ',', map { toString($_) } @$a ) . ']';
}
Expand Down Expand Up @@ -206,7 +210,8 @@ sub simplify {
my $this = shift;

if ( $this->evaluatesToConstant(@_) ) {
my $c = $this->evaluate(@_) || 0;
my $c = $this->evaluate(@_);
$c = 0 unless defined $c;
if ( $c =~ /^[+-]?(\d+\.\d+|\d+\.|\.\d+|\d+)([eE][+-]?\d+)?$/ ) {
$this->makeConstant(Foswiki::Infix::Node::NUMBER, $c);
}
Expand Down

0 comments on commit e32de23

Please sign in to comment.