The foswiki svn repository will become read-only on Friday 8/8. Developers should register for a http://github.com/ account for commit access to foswiki.

Item8063: decode formfields before caching them

Priority: CurrentState: AppliesTo: Component: WaitingFor:
Enhancement Closed Extension DBCacheContrib  
The encoding of chars like newline-linefeed are encoded to fit them into a %META:FIELD. However when searching for a value in formfields using regular expressions these encodings are not what you'd like to deal with. For instance, a keyword search like Comments=~'\bOracle\b' won't find topics that have "Oracle" in the first column/second line as this is encoded as %0d%0aOracle. The extra %0a before the string prevents it to be found although it should.

The obvious solution would be to decode any formfield before caching it as the cache does not require the data to be encoded. I can't think of a case where matching the specific entity-encoded strings is desirable. Crawford, can you?

-- MichaelDaum - 24 Feb 2009

No, but I also can't think of a case where a regular expression search of formfield data is a good idea. Most DBs only support the LIKE operator, and supporting regex searches would require iteration over the entire DB. I would far rather deprecate the use of regex searches outside of the topic text completely. The encoding is highly specific to the inefficiency of the current store implementation.

-- CrawfordCurrie - 24 Feb 2009

However you motivate it - either by regexing formfields or otherwise - I can't see a reason to cache formfields in encoded format. Do you agree?

-- MichaelDaum - 24 Feb 2009

Yes. The encoding is a mechanism used by the textfile-based store, and should not reach the cache.

-- CrawfordCurrie - 26 Feb 2009

I changed to using readTopic rather than doing a native read, this problem should no longer apply.

-- CrawfordCurrie - 07 Apr 2009

ItemTemplate edit

Summary decode formfields before caching them
ReportedBy Foswiki:Main.MichaelDaum
Codebase
SVN Range Foswiki-1.0.0, Thu, 08 Jan 2009, build 1878
AppliesTo Extension
Component DBCacheContrib
Priority Enhancement
CurrentState Closed
WaitingFor
Checkins Foswikirev:3383
ReleasedIn
Topic revision: r5 - 07 Apr 2009, CrawfordCurrie
 
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. see CopyrightStatement. Creative Commons License