Try to trap errors while loading classes. Fixes bug #12321.

This commit is contained in:
Colin Kuskie 2012-01-26 16:04:02 -08:00
parent 3a3227cd6d
commit 20e49b51d6
2 changed files with 6 additions and 2 deletions

View file

@ -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

View file

@ -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} }) {