You are here: Foswiki>Tasks Web>Item1623 (07 Feb 2017, LynnwoodBrown)Edit Attach

Item1623: DBQUERY from DBCachePlugin doesn't work with PublishPlugin

pencil
Priority: Normal
Current State: No Action Required
Released In: n/a
Target Release: n/a
Applies To: Extension
Component: PublishPlugin
Branches:
Reported By: MarcSCHAEFER
Waiting For: Main.MarcSCHAEFER
Last Change By: LynnwoodBrown
DESCRIPTION If you use a %DBQUERY% request from the TWiki DBCachePlugin on Foswiki, it will work. However, when used through PublishPlugin from command line it won't, there is no specific error.

UGLY WORK-AROUND vi lib/TWiki/Plugins/DBCachePlugin/Core.pm around line 65 (function init) $baseWeb = 'Main';

MORE DEBUGGING INFO This is what you get from a normal run:

- DBCachePlugin - called renderWikiWordHandler(Foswiki, 1, Main, WebHome)
- DBCachePlugin - called renderWikiWordHandler(MarcSCHAEFER, 0, Main, MarcSCHAEFER)
- DBCachePlugin - called getDB(Main)
- DBCachePlugin - fresh reload of 'Main'
- DBCachePlugin - loading new webdb for 'Main(1) '
This is what you get from a command line PublishPlugin:
- DBCachePlugin - called handleDBQUERY("1" format="|$formfield(EventDate)| $formfield(EventType)| [[$web.$topic][$formfield(ShortTitle)]]| $formfield(GestionDesLieux)| $formfield(EventTime)| $formfield(EventSpeaker)| $formfield(EventManager)|" include="^Activite[A-Z0-9]")
- DBCachePlugin - called getDB(PublishPlugin)
- DBCachePlugin - fresh reload of 'PublishPlugin'
- DBCachePlugin - loading new webdb for 'PublishPlugin(1) '

I haven't yet followed the complete stack from the caller of the init function to DBCachePlugin, but there is definitely a Foswiki or TWiki session variable which is not set correctly!


It seems as if the BASEWEB variable is not set correctly by the cmdline call to the Foswiki REST handler. One way to set it is to specify an explicit topic parameter. Otherwise the core will try to derive the BASEWEB and BASETOPIC settings from the URL. That's where it has got the fresh reload of 'PublishPlugin' from. It tries to load the cache of the current web which is PublishPlugin according to the URL ... which is wrong.

The longer I think about it the more I am convinced that this is an error of the REST scheduler in the core. The way it derives BASEWEB and BASETOPIC from a REST URL is mostly always wrong as SUBJECT/VERB get into the way. At the very least it should default to USERSWEB/WEBHOME instead.

-- MichaelDaum - 15 May 2009

I'm pretty sure this will work now, as I fixed the BASEWEB etc. Please try it with the latest version of the plugin and let me know.

-- CrawfordCurrie - 12 Jun 2009

Unfortunately it doesn't.

Versions:
  • PublishPlugin our $VERSION = '$Rev: 3991 (2009-05-30) $'; our $RELEASE = '18 May 2009';
  • (TWiki) DBCachePlugin $VERSION = '$Rev: 2426 (09 Feb 2009) $'; $RELEASE = '2.12';

The above documented work-around (add $baseWeb = 'Main' in init() of DBCachePlugin/Core.pm)

All from (etch) packages installed today from fosiki.org

-- MarcSCHAEFER - 14 Jun 2009

As of Febrary, 2017, I can confirm that I'm using PublishPlugin with extensive use of DBCachePlugin (ver. 2.50). The macros (DBQUERY & DBCALL mostly) work in both skin templates and topics. I have published both via command line and with web forms. I am not seeing any of the issues reported here. Since this task is nearly 7 years old, it's possible that a more recent update resolved the issue. For this reason, I've changing the status of this task to "No Action Required".

-- LynnwoodBrown - 07 Feb 2017

ItemTemplate edit

Summary DBQUERY from DBCachePlugin doesn't work with PublishPlugin
ReportedBy MarcSCHAEFER
Codebase 1.0.5
SVN Range Foswiki-1.0.0, Thu, 08 Jan 2009, build 1878
AppliesTo Extension
Component PublishPlugin
Priority Normal
CurrentState No Action Required
WaitingFor MarcSCHAEFER
Checkins
TargetRelease n/a
ReleasedIn n/a
CheckinsOnBranches
trunkCheckins
masterCheckins
ItemBranchCheckins
Release02x01Checkins
Release02x00Checkins
Release01x01Checkins
Topic revision: r6 - 07 Feb 2017, LynnwoodBrown
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