You are here: Foswiki>Tasks Web>Item10338 (20 Mar 2011, PaulHarvey)Edit Attach

Item10338: Something broke

pencil
Priority: Normal
Current State: Closed
Released In: n/a
Target Release: n/a
Applies To: Extension
Component: MongoDBPlugin
Branches:
Reported By: PaulHarvey
Waiting For: PaulHarvey
Last Change By: PaulHarvey
%SEARCH{
    "form.name='System.UserForm' AND lc(LastName)=~lc('ol')"
   type="query"
   web="%USERSWEB%"
}%

Results in error
         Could not perform search. Error was: query error: error on invocation of $where function:
JS Error: TypeError: this.FIELD.LastName has no properties nofile_a:0 at /usr/local/src/git.trin.org.au/core/lib/Foswiki/Search/MongoDBInfoCache.pm line 55.
 at /usr/local/src/git.trin.org.au/core/lib/Foswiki/Search/MongoDBInfoCache.pm line 55
   Foswiki::Search::MongoDBInfoCache::numberOfTopics('Foswiki::Search::MongoDBInfoCache=HASH(0x3853f88)') called at /usr/local/src/git.trin.org.au/core/lib/Foswiki/Search/MongoDBInfoCache.pm line 39
   Foswiki::Search::MongoDBInfoCache::new('Foswiki::Search::MongoDBInfoCache', 'Foswiki=HASH(0x10beb28)', 'Main', 'HASH(0x369cb68)', 'MongoDB::Cursor=HASH(0x3c3c0f0)') called at /usr/local/src/git.trin.org.au/core/lib/Foswiki/Store/QueryAlgorithms/MongoDB.pm line 172
   Foswiki::Store::QueryAlgorithms::MongoDB::_webQuery('Foswiki::Query::Node=HASH(0x371e348)', 'Main', undef, 'Foswiki=HASH(0x10beb28)', 'HASH(0x369cb68)') called at /usr/local/src/git.trin.org.au/core/lib/Foswiki/Store/QueryAlgorithms/MongoDB.pm line 84
   Foswiki::Store::QueryAlgorithms::MongoDB::query('Foswiki::Query::Node=HASH(0x371e348)', undef, 'Foswiki=HASH(0x10beb28)', 'HASH(0x369cb68)') called at /usr/local/src/git.trin.org.au/core/lib/Foswiki/Store/VC/Store.pm line 500
   Foswiki::Store::VC::Store::query('Foswiki::Store::RcsWrap=HASH(0x1138cc8)', 'Foswiki::Query::Node=HASH(0x371e348)', undef, 'Foswiki=HASH(0x10beb28)', 'HASH(0x369cb68)') called at /usr/local/src/git.trin.org.au/core/lib/Foswiki/Meta.pm line 850
   Foswiki::Meta::query('Foswiki::Query::Node=HASH(0x371e348)', undef, 'HASH(0x369cb68)') called at /usr/local/src/git.trin.org.au/core/lib/Foswiki/Search.pm line 350
   Foswiki::Search::searchWeb('Foswiki::Search=HASH(0x3535e30)', 'web', 'Main', 'search', 'form.name=\'System.UserForm\' AND lc(LastName)=~lc(\'ol\')', 'basetopic', 'TestTopic0', 'baseweb', 'Sandbox', ...) called at /usr/local/src/git.trin.org.au/core/lib/Foswiki/Macros/SEARCH.pm line 32
   Foswiki::__ANON__() called at /usr/share/perl5/Error.pm line 416
   eval {...} called at /usr/share/perl5/Error.pm line 408
   Error::subs::try('CODE(0x3617700)', 'HASH(0x3535cf8)') called at /usr/local/src/git.trin.org.au/core/lib/Foswiki/Macros/SEARCH.pm line 41
   Foswiki::SEARCH('Foswiki=HASH(0x10beb28)', 'Foswiki::Attrs=HASH(0x36176a0)', 'Foswiki::Meta=HASH(0x31eccb8)') called at /usr/local/src/git.trin.org.au/core/lib/Foswiki.pm line 3031
   Foswiki::_expandMacroOnTopicRendering('Foswiki=HASH(0x10beb28)', 'SEARCH', '\x{a}    "form.name=\'System.UserForm\' AND lc(LastName)=~lc(\'ol...', 'Foswiki::Meta=HASH(0x31eccb8)') called at /usr/local/src/git.trin.org.au/core/lib/Foswiki.pm line 2912
   Foswiki::_processMacros('Foswiki=HASH(0x10beb28)', '

-- PaulHarvey - 10 Feb 2011

mmmm, this is something odd :/

and of course, right now its working ok for me.

Wed Feb 23 22:06:12 [conn15] query foswiki.$cmd ntoreturn:1 command: { count: "current", query: { orderby: { _topic: 1 }, query: { FORM.name: "System.UserForm", _web: "TemporarySEARCHUsersWeb", $where: "( /ol/.test(this.FIELD.LastName.value.toLowerCase()) )" } } } reslen:64 118ms

but I have seen something like this when (for eg, it eval's a topic that doesn't have part of the field.)

I may well have to keep track of the stack of members i'm testing in js, and check for existance frown, sad smile

-- SvenDowideit - 23 Feb 2011

I'll retest soon

-- PaulHarvey - 23 Feb 2011

That commit should take care of it - unless I missed some painful corner of h*ll.

-- SvenDowideit - 13 Mar 2011

Problem seems fixed, thankyou

-- PaulHarvey - 20 Mar 2011
 
Topic revision: r6 - 20 Mar 2011, PaulHarvey
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy