File tree 3 files changed +19
-2
lines changed
3 files changed +19
-2
lines changed Original file line number Diff line number Diff line change 1
1
7.10.25
2
+ - fixed #12365: editing a metadata may cause a fatal error (Arjan Widlak / United Knowledge)
2
3
- fixed #12346: toVersion in upgrade_7.9.34-7.10.22.pl was "0.0.0"
3
4
- fixed #12010 related link duplication where links have group view restrictions
4
5
- fixed #12297: keywords.form missing from Post template help
Original file line number Diff line number Diff line change @@ -388,6 +388,7 @@ sub www_editMetaDataField {
388
388
my %usedNames ;
389
389
for my $class (WebGUI::Pluggable::findAndLoad(' WebGUI::Asset' )) {
390
390
next unless $class -> isa(' WebGUI::Asset' );
391
+ next unless isIn( $class , keys %{ $self -> session-> config-> get(" assets" ) } );
391
392
my $name = $class -> definition($self -> session)-> [0]-> {assetName };
392
393
next unless $name ; # abstract classes (e.g. wobject) don't have names
393
394
@@ -480,7 +481,7 @@ sub www_editMetaDataFieldSave {
480
481
481
482
# -------------------------------------------------------------------
482
483
483
- =head2 www_manageMetaData ( )
484
+ =head2 www_manageMetaData ( )n
484
485
485
486
Returns an AdminConsole to deal with MetaDataFields. If isInGroup(4) is False, renders an insufficient privilege page.
486
487
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ use WebGUI::VersionTag;
24
24
25
25
use Test::More; # increment this value for each test you create
26
26
use Test::Deep;
27
- plan tests => 16 ;
27
+ plan tests => 17 ;
28
28
29
29
my $session = WebGUI::Test-> session;
30
30
$session -> user({userId => 3});
@@ -305,6 +305,21 @@ subtest 'asset metadata versioning' => sub {
305
305
is $count_all -> ($dup ), 1, ' one value for dup' ;
306
306
};
307
307
308
+ # Check that www_editMetaDataField doesn't return assets that are not configured
309
+ # for this site and that sub definition is not executed if the asset is not
310
+ # configured in the config, which may cause a fatal error.
311
+
312
+ # Temporarily remove asset Article from config
313
+ $session -> config-> deleteFromHash( ' assets' , ' WebGUI::Asset::Wobject::Article' );
314
+ unlike(
315
+ my $got = $root -> www_editMetaDataField(),
316
+ qr / WebGUI::Asset::Wobject::Article/ ,
317
+ ' article was (temporarily) not in config and should not appear in form'
318
+ );
319
+ # Restore config:
320
+ $session -> config-> addToHash( ' assets' , ' WebGUI::Asset::Wobject::Article' );
321
+
322
+
308
323
sub buildNameIndex {
309
324
my ($fidStruct ) = @_ ;
310
325
my $nameStruct ;
You can’t perform that action at this time.
0 commit comments