Skip to content

Commit 20e49b5

Browse files
committedJan 27, 2012
Try to trap errors while loading classes. Fixes bug #12321.

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed
 

‎docs/changelog/7.x.x.txt

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
7.10.25
2+
- fixed #12321: Error while deleting a group.
23

34
7.10.24
45
- fixed #12318: asset error causes asset manager to fail

‎lib/WebGUI/Group.pm

+5-2
Original file line numberDiff line numberDiff line change
@@ -1625,8 +1625,11 @@ sub resetGroupFields {
16251625
##Note, I did assets in SQL instead of using the API because you would have to
16261626
##instanciate every version of the asset that used the group. This should be much quicker
16271627
ASSET: foreach my $assetClass ($db->buildArray('SELECT DISTINCT className FROM asset')) {
1628-
next ASSET unless $db->quickScalar( "SELECT COUNT(*) FROM asset WHERE className=?", [$assetClass] );
1629-
my $definition = WebGUI::Pluggable::instanciate($assetClass, 'definition', [$session]);
1628+
my $definition = eval { WebGUI::Pluggable::instanciate($assetClass, 'definition', [$session]); };
1629+
if ($@) {
1630+
$session->log->error("Unable to load className: " . $className . " when looking for asset definitions: " . $@);
1631+
next ASSET;
1632+
}
16301633
SUBDEF: foreach my $subdef (@{ $definition }) {
16311634
next SUBDEF if exists $tableCache->{$subdef->{tableName}};
16321635
PROP: while (my ($fieldName, $properties) = each %{ $subdef->{properties} }) {

0 commit comments

Comments
 (0)
Please sign in to comment.