Item14451: edited topics don't validate - (500) Internal server error - Invalid web '-Xx.LastXx' in topics
Priority: Enhancement
Current State: No Action Required
Released In: n/a
Target Release:
validateWebTopicName()
fails to validate items that were prefixed with a minus sign to edit them out of the list of topics. For example, using the topics list from the documentation:
$ perl rest /PublishPlugin/publish format=file topics='*.*,-*.Last*,*.Last*'
*Publisher:* AdminUser
*Date:* 2017-08-01 - 14:55
format = 'file'
topics = '*.*,-*.Last*,*.Last*'
ERROR: (500) Internal server error - Invalid web '-Xx.LastXx' in topics at .../lib/Foswiki/Plugins/PublishPlugin/Publisher.pm line 180.
at .../lib/Foswiki/Plugins/PublishPlugin/Publisher.pm line 180.
Foswiki::Plugins::PublishPlugin::Publisher::validateWebTopicName("-Xx.LastXx", "topics") called at .../lib/Foswiki/Plugins/PublishPlugin/Publisher.pm line 157
Foswiki::Plugins::PublishPlugin::Publisher::validateWebTopicWildcard("-*.Last*", "topics") called at .../lib/Foswiki/Plugins/PublishPlugin/Publisher.pm line 122
A possible fix would be (tested here, works for me):
--- a/lib/Foswiki/Plugins/PublishPlugin/Publisher.pm
+++ b/lib/Foswiki/Plugins/PublishPlugin/Publisher.pm
@@ -163,6 +163,8 @@ sub validateWebTopicName {
return undef unless defined $v;
+ $v =~ s/^-//;
+
my ( $w, $t );
if ( $v =~ /\./ ) {
( $w, $t ) = split( /\./, $v, 2 );
--
FlorianSchlichting - 01 Aug 2017
The - is used to indicate that matching topics are to be excluded, it can't just be ignored.
I don't get this error with the latest code, it looks like it was fixed in
Item14452.
--
Main.CrawfordCurrie - 30 Jan 2018 - 09:39