Remove use of getAttribute from Asset.pm. Tweak a few tests.
This commit is contained in:
parent
bf0c95d910
commit
04ed78e8f1
2 changed files with 7 additions and 7 deletions
|
|
@ -38,7 +38,7 @@ around title => sub {
|
|||
if (@_ > 0) {
|
||||
my $title = shift;
|
||||
$title = WebGUI::HTML::filter($title, 'all');
|
||||
$title = $self->meta->get_attribute('title')->default if $title eq '';
|
||||
$title = $self->meta->find_attribute_by_name('title')->default if $title eq '';
|
||||
unshift @_, $title;
|
||||
}
|
||||
$self->$orig(@_);
|
||||
|
|
@ -1114,7 +1114,7 @@ If this evaluates to True, then the smaller extras/adminConsole/small/assets.gif
|
|||
|
||||
sub getIcon {
|
||||
my ($self, $small) = @_;
|
||||
my $icon = $self->getAttribute("icon");
|
||||
my $icon = $self->icon;
|
||||
return $self->session->url->extras('assets/small/'.$icon) if ($small);
|
||||
return $self->session->url->extras('assets/'.$icon);
|
||||
}
|
||||
|
|
@ -1181,7 +1181,7 @@ returning results. This allows very large sets of results to be handled in chun
|
|||
|
||||
sub getIsa {
|
||||
my ($class, $session, $offset) = @_;
|
||||
my $tableName = $class->getAttribute('tableName');
|
||||
my $tableName = $class->tableName;
|
||||
my $sql = "select distinct(assetId) from $tableName";
|
||||
if (defined $offset) {
|
||||
$sql .= ' LIMIT '. $offset . ',1234567890';
|
||||
|
|
@ -1522,7 +1522,7 @@ sub getUiLevel {
|
|||
my $className = $self->get("className");
|
||||
return $uiLevel # passed in
|
||||
|| $self->session->config->get("assets/".$className."/uiLevel") # from config
|
||||
|| $self->getAttribute('uiLevel') # from definition
|
||||
|| $self->uiLevel # from definition
|
||||
|| 1; # if all else fails
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ note "loadModule";
|
|||
|
||||
# Test the default constructor
|
||||
my $defaultAsset = WebGUI::Asset->getDefault($session);
|
||||
is($defaultAsset, 'WebGUI::Asset::Wobject::Layout');
|
||||
isa_ok($defaultAsset, 'WebGUI::Asset::Wobject::Layout');
|
||||
|
||||
# Test the new constructor
|
||||
my $assetId = "PBnav00000000000000001"; # one of the default nav assets
|
||||
|
|
@ -192,7 +192,7 @@ ok( WebGUI::Asset->urlExists($session, $importUrl, {assetId => 'notAnWebGUI
|
|||
|
||||
my $i18n = WebGUI::International->new($session, 'Asset_Wobject');
|
||||
is($importNode->getName, $i18n->get('assetName', 'Asset_Folder'), 'getName: Returns the internationalized name of the Asset, core Asset');
|
||||
#is($canEditAsset->getName, $i18n->get('asset', 'Asset'), 'getName: Returns the internationalized name of the Asset, core Asset');
|
||||
|
||||
################################################################
|
||||
#
|
||||
# addEditLabel
|
||||
|
|
@ -382,7 +382,7 @@ TODO: {
|
|||
|
||||
$session->user({ userId => 3 });
|
||||
$session->var->switchAdminOff;
|
||||
is($rootAsset->addMissing('/nowhereMan'), undef, q{addMissing doesn't return anything unless use is in Admin Mode});
|
||||
is($rootAsset->addMissing('/nowhereMan'), undef, q{addMissing doesn't return anything unless user is in Admin Mode});
|
||||
|
||||
$session->var->switchAdminOn;
|
||||
my $addMissing = $rootAsset->addMissing('/nowhereMan');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue