This question about Using an extension: Asked

DBCALL does not always honour section=

DBCALL does not always honour the form DBCALL{ "topic" section="sectionname" }

After some trial and error I found the problem to be in the whitespace used in the ENDSECTION{"sectionname"}

This does work: ENDSECTION{"sectionname"}
and this does not: ENDSECTION{ "sectionname" }

This issue is in WebDB.pm. The regex does not allow whitespace after the closing quote in the match for ENDSECTION. Here is the patch:
diff --git a/lib/Foswiki/Plugins/DBCachePlugin/WebDB.pm b/lib/Foswiki/Plugins/DBCachePlugin/WebDB.pm
index 7f66e90..d7f8d0a 100644
--- a/lib/Foswiki/Plugins/DBCachePlugin/WebDB.pm
+++ b/lib/Foswiki/Plugins/DBCachePlugin/WebDB.pm
@@ -126,7 +126,7 @@ sub onReload {
     my $archivist = $this->getArchivist();

     my @sections = ();
-    while ($text =~ s/%(?:START)?SECTION\{(.*?)\}%(.*?)%(?:STOP|END)SECTION\{[^}]*?"(.*?)"\}%//s) {
+    while ($text =~ s/%(?:START)?SECTION\{(.*?)\}%(.*?)%(?:STOP|END)SECTION\{[^}]*?"(.*?)"\s*\}%//s) {
       my $attrs = new Foswiki::Attrs($1);
       my $name = $attrs->{name} || $attrs->{_DEFAULT} || '';
       my $sectionText = $2;

-- BramVanOosterhout - 29 May 2020

Thanks! Is it just the additional \s* ? ... just to make sure wink

-- MichaelDaum - 29 May 2020

Yes, that made it work for me. I have not run the tests, but the fix seems logical.

-- BramVanOosterhout - 30 May 2020
 

QuestionForm edit

Subject Using an extension
Extension DBCachePlugin
Version Foswiki 2.1.6
Status Asked
Related Topics
Topic revision: r3 - 30 May 2020, BramVanOosterhout
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