You are here: Foswiki>Tasks Web>Item13768 (08 Mar 2016, MichaelDaum)Edit Attach

Item13768: Fix odd behavior in afterSaveHandler with unusual base topic.

pencil
Priority: Normal
Current State: No Action Required
Released In: n/a
Target Release: n/a
Applies To: Extension
Component: DBCachePlugin
Branches:
Reported By: MaikGlatki
Waiting For:
Last Change By: MichaelDaum
The DBCachePlugin afterSaveHandler defaults to $baseWeb and $baseTopic (actually $web and $topic from initPlugin()). When called with an unusual web, i.e. via a REST handler, e.g. bin/rest/ExamplePlugin/handlername?arg=val $web might be set to "ExamplePlugin" in initPlugin(), causing suprisingly hard to trace errors.

-- MaikGlatki - 30 Sep 2015

Proposed patch: https://github.com/foswiki/DBCachePlugin/pull/1 -- MaikGlatki - 30 Sep 2015 Was wrong. -- Main.MaikGlatki - 01 Oct 2015 - 08:04

Will look into this. However remember to ALWAYS set the topic parameter to any REST call. This is important. ALL of the Foswiki core will behave unusual when no proper web.topic can be derived from the pathinfo ... as is the case for REST calls.

-- MichaelDaum - 30 Sep 2015

After careful review by JanKrueger, we came up with a better solution proposal: https://github.com/mgla/DBCachePlugin/commit/890362e550d7b7c91b6ba12e260ef30201d13b70

-- MaikGlatki - 01 Oct 2015

Did you read my previous comment from 30 Sep 2015, as adding a topic parameter to your REST call fixes the problem not only for DBCachePlugin assuming $session->{webName} and $session->{topicName} are correct web and topic entries.

-- MichaelDaum - 26 Jan 2016

Don't seem to get a reply here. Please reopen in case there is still an issue.

-- MichaelDaum - 08 Mar 2016
 

ItemTemplate edit

Summary Fix odd behavior in afterSaveHandler with unusual base topic.
ReportedBy MaikGlatki
Codebase
SVN Range
AppliesTo Extension
Component DBCachePlugin
Priority Normal
CurrentState No Action Required
WaitingFor
Checkins
TargetRelease n/a
ReleasedIn n/a
CheckinsOnBranches
trunkCheckins
masterCheckins
ItemBranchCheckins
Release02x01Checkins
Release02x00Checkins
Release01x01Checkins
Topic revision: r6 - 08 Mar 2016, MichaelDaum
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