Item9825: DEPRECATE Foswiki::Func::searchInWebContent, and add Foswiki::Func::query

pencil
Priority: Urgent
Current State: Closed
Released In: 1.1.1
Target Release: patch
Applies To: Engine
Component:
Branches:
Reported By: KerstinPuschke
Waiting For:
Last Change By: JonathanManning
In Foswiki 1.1.0, the ACTIONSEARCH macro of the ActionTrackerPlugin does not work any more. It always displays an empty list, as if there were no matching ACTIONs. To confirm this bug, install ActionTrackerPlugin, load System.ActionTrackerPlugin and look at the example in the section 'Plugin Installation Instructions'. Logfiles do not show anything.

-- KerstinPuschke - 13 Oct 2010

I experience the same.

-- LarsEik - 13 Oct 2010

Looks like the bug is due to the changes in Foswiki::Func::searchInWebContent. It returns an iterator now, while it used to return a hashref. Probably easy to fix. Maybe I can provide a patch in a couple of days.

-- KerstinPuschke - 15 Oct 2010

I can confirm this issue.

Who changed the Func API? We are not supposed to change Func API EVER unless it is done in a backwards compatible way like when adding additional parameters.

I am changing this to a core bug. This needs to be reverted back to compatibility in 1.1.1

OR all plugins on Foswiki SVN fixed to work with the new interface AS WELL AS THE OLD 1.0.X one!!!

The affected plugins are BioKbPlugin, ObjectPlugin, ValidateUrlsPlugin, ActionTrackerPlugin

I have not checked which of these have already been fixed. But ActionTrackerPlugin is for sure broken.

-- KennethLavrsen - 16 Oct 2010

From the irc logs, its been correctly identified that I changed the API, and failed to update / work out a strategy for existing users of the function.

The sad thing is, the old implementation simply cannot scale to larger topic counts - and it provided all sorts of performance issues for new stores (which return iterators / cursors)

-- SvenDowideit - 16 Oct 2010

$grep = new Foswiki::ListIterator(keys(%$grep)) if (ref($grep) eq 'HASH')

-- SvenDowideit - 16 Oct 2010

brought back the old API, and added a new one Foswiki::Func::query()

-- SvenDowideit - 18 Oct 2010

Sven forgot just one occurence in Rename.pm, caught by the unit tests.

-- OlivierRaginel - 20 Oct 2010

I have released a fixed version of ActionTrackerPlugin so people on 1.1.0 can run until 1.1.1 is out.

-- KennethLavrsen - 21 Oct 2010

I am the developer of BioKbPlugin and I'm trying to fix the issues created by this API change. Is there a replacement for the grep-like functionality of searchInWebContent that can be used to return the actual matching lines- or do I have to open each topic in turn? I'm working with 1.1.3

-- JonathanManning - 02 May 2011

sorry, you're right, I didn't work out a way to maintain the grep like functionality - sadly, its been broken in most contexts for a long time. I think you need to open each of the matching topics in turn. however we could write an iterator that does it for you, so that when/if we bring it back you're insulated from it..

-- SvenDowideit - 03 May 2011

That would be great- let me know what's needed from me. I've done the opening-in-turn thing on my own systems, and stepped around the resulting performance hit with judicoius use of Memcache- but it would be good to get this working better in case other people want to use and/or adapt the plugin.

-- JonathanManning - 04 May 2011
 

ItemTemplate edit

Summary DEPRECATE Foswiki::Func::searchInWebContent, and add Foswiki::Func::query
ReportedBy KerstinPuschke
Codebase 1.1.0
SVN Range
AppliesTo Engine
Component
Priority Urgent
CurrentState Closed
WaitingFor
Checkins distro:fdce51280e81 ActionTrackerPlugin:48654b921f2d distro:7c0695005ed5 distro:f2d1c597ae45 distro:5915660cb877
TargetRelease patch
ReleasedIn 1.1.1
Topic revision: r19 - 04 May 2011, JonathanManning
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