Skip to content

Commit

Permalink
Try to trap errors while loading classes. Fixes bug #12321.
Browse files Browse the repository at this point in the history
  • Loading branch information
perlDreamer committed Jan 27, 2012
1 parent 3a3227c commit 20e49b5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions docs/changelog/7.x.x.txt
@@ -1,4 +1,5 @@
7.10.25
- fixed #12321: Error while deleting a group.

7.10.24
- fixed #12318: asset error causes asset manager to fail
Expand Down
7 changes: 5 additions & 2 deletions lib/WebGUI/Group.pm
Expand Up @@ -1625,8 +1625,11 @@ sub resetGroupFields {
##Note, I did assets in SQL instead of using the API because you would have to
##instanciate every version of the asset that used the group. This should be much quicker
ASSET: foreach my $assetClass ($db->buildArray('SELECT DISTINCT className FROM asset')) {
next ASSET unless $db->quickScalar( "SELECT COUNT(*) FROM asset WHERE className=?", [$assetClass] );
my $definition = WebGUI::Pluggable::instanciate($assetClass, 'definition', [$session]);
my $definition = eval { WebGUI::Pluggable::instanciate($assetClass, 'definition', [$session]); };
if ($@) {
$session->log->error("Unable to load className: " . $className . " when looking for asset definitions: " . $@);
next ASSET;
}
SUBDEF: foreach my $subdef (@{ $definition }) {
next SUBDEF if exists $tableCache->{$subdef->{tableName}};
PROP: while (my ($fieldName, $properties) = each %{ $subdef->{properties} }) {
Expand Down

0 comments on commit 20e49b5

Please sign in to comment.