newByDynamicClass changed to newById
This commit is contained in:
parent
0fd922daed
commit
49bd7f5032
41 changed files with 94 additions and 94 deletions
|
|
@ -478,7 +478,7 @@ sub getEventNext {
|
|||
|
||||
|
||||
return undef unless $events->[0];
|
||||
return WebGUI::Asset->newByDynamicClass($self->session,$events->[0]);
|
||||
return WebGUI::Asset->newById($self->session,$events->[0]);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -534,7 +534,7 @@ sub getEventPrev {
|
|||
});
|
||||
|
||||
return undef unless $events->[0];
|
||||
return WebGUI::Asset->newByDynamicClass($self->session,$events->[0]);
|
||||
return WebGUI::Asset->newById($self->session,$events->[0]);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -1722,7 +1722,7 @@ sub processPropertiesFromFormPost {
|
|||
});
|
||||
|
||||
for my $eventId (@{$events}) {
|
||||
my $event = WebGUI::Asset->newByDynamicClass($session, $eventId);
|
||||
my $event = WebGUI::Asset->newById($session, $eventId);
|
||||
|
||||
# Add a revision
|
||||
$properties{ startDate } = $event->get("startDate");
|
||||
|
|
|
|||
|
|
@ -541,7 +541,7 @@ sub makeShortcut {
|
|||
croak "GalleryFile->makeShortcut: parentId must be defined"
|
||||
unless $parentId;
|
||||
|
||||
my $parent = WebGUI::Asset->newByDynamicClass($session, $parentId)
|
||||
my $parent = WebGUI::Asset->newById($session, $parentId)
|
||||
|| croak "GalleryFile->makeShortcut: Could not instanciate asset '$parentId'";
|
||||
|
||||
my $shortcut
|
||||
|
|
@ -1013,7 +1013,7 @@ sub www_makeShortcut {
|
|||
my $albums = $self->getGallery->getAlbumIds;
|
||||
my %albumOptions;
|
||||
for my $assetId ( @$albums ) {
|
||||
my $asset = WebGUI::Asset->newByDynamicClass($session, $assetId);
|
||||
my $asset = WebGUI::Asset->newById($session, $assetId);
|
||||
if ($asset->canAddFile) {
|
||||
$albumOptions{ $assetId } = $asset->get("title");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -591,7 +591,7 @@ sub getShortcutByCriteria {
|
|||
$scratchId = "Shortcut_" . $assetId;
|
||||
if($self->session->scratch->get($scratchId) && !$self->getValue("disableContentLock")) {
|
||||
unless ($self->session->var->isAdminOn) {
|
||||
return WebGUI::Asset->newByDynamicClass($self->session, $self->session->scratch->get($scratchId));
|
||||
return WebGUI::Asset->newById($self->session, $self->session->scratch->get($scratchId));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -675,7 +675,7 @@ sub getShortcutByCriteria {
|
|||
# Store the matching assetId in user scratch.
|
||||
$self->session->scratch->set($scratchId,$id) if ($scratchId);
|
||||
|
||||
return WebGUI::Asset->newByDynamicClass($self->session, $id);
|
||||
return WebGUI::Asset->newById($self->session, $id);
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -688,7 +688,7 @@ Return the asset that this Shortcut points to.
|
|||
|
||||
sub getShortcutDefault {
|
||||
my $self = shift;
|
||||
return WebGUI::Asset->newByDynamicClass($self->session, $self->get("shortcutToAssetId"));
|
||||
return WebGUI::Asset->newById($self->session, $self->get("shortcutToAssetId"));
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -1163,7 +1163,7 @@ sub www_editOverride {
|
|||
$params{label} = $params{label} || $i18n->get("Edit Field Directly");
|
||||
$params{hoverHelp} = $params{hoverHelp} || $i18n->get("Use this field to edit the override using the native form handler for this field type");
|
||||
|
||||
if ($params{fieldType} eq 'template') {$params{namespace} = $params{namespace} || WebGUI::Asset->newByDynamicClass($self->session, $origValue)->get("namespace");}
|
||||
if ($params{fieldType} eq 'template') {$params{namespace} = $params{namespace} || WebGUI::Asset->newById($self->session, $origValue)->get("namespace");}
|
||||
|
||||
$f->dynamicField(%params);
|
||||
$f->textarea(
|
||||
|
|
|
|||
|
|
@ -482,7 +482,7 @@ The sku attached to the object you wish to instanciate.
|
|||
sub newBySku {
|
||||
my ($class, $session, $sku) = @_;
|
||||
my $assetId = $session->db->quickScalar("select assetId from sku where sku=?", [$sku]);
|
||||
return WebGUI::Asset->newByDynamicClass($session, $assetId);
|
||||
return WebGUI::Asset->newById($session, $assetId);
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -1794,7 +1794,7 @@ sub view {
|
|||
$segment = $self->session->icon->delete('func=deleteAccessoryConfirm&aid='.$id,$self->get('url'),$i18n->get(2))
|
||||
. $self->session->icon->moveUp('func=moveAccessoryUp&aid='.$id,$self->get('url'))
|
||||
. $self->session->icon->moveDown('func=moveAccessoryDown&aid='.$id,$self->get('url'));
|
||||
my $accessory = WebGUI::Asset->newByDynamicClass($session, $collateral->{accessoryAssetId});
|
||||
my $accessory = WebGUI::Asset->newById($session, $collateral->{accessoryAssetId});
|
||||
push(@accessoryloop,{
|
||||
'accessory_URL' => $accessory->getUrl,
|
||||
'accessory_title' => $accessory->getTitle,
|
||||
|
|
@ -1811,7 +1811,7 @@ sub view {
|
|||
$segment = $self->session->icon->delete('func=deleteRelatedConfirm&rid='.$id, $self->get('url'),$i18n->get(4))
|
||||
. $self->session->icon->moveUp('func=moveRelatedUp&rid='.$id, $self->get('url'))
|
||||
. $self->session->icon->moveDown('func=moveRelatedDown&rid='.$id, $self->get('url'));
|
||||
my $related = WebGUI::Asset->newByDynamicClass($session, $collateral->{relatedAssetId});
|
||||
my $related = WebGUI::Asset->newById($session, $collateral->{relatedAssetId});
|
||||
push(@relatedloop,{
|
||||
'relatedproduct_URL' => $related->getUrl,
|
||||
'relatedproduct_title' => $related->getTitle,
|
||||
|
|
|
|||
|
|
@ -393,7 +393,7 @@ sub getThingy {
|
|||
"SELECT assetId FROM Thingy_things WHERE thingId=?",
|
||||
[ $self->get('thingId') ],
|
||||
);
|
||||
return WebGUI::Asset->newByDynamicClass( $self->session, $thingyId );
|
||||
return WebGUI::Asset->newById( $self->session, $thingyId );
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -424,7 +424,7 @@ sub processPropertiesFromFormPost {
|
|||
my @attachments = $self->session->form->param("attachments");
|
||||
my @tags = ();
|
||||
foreach my $assetId (@attachments) {
|
||||
my $asset = WebGUI::Asset->newByDynamicClass($self->session, $assetId);
|
||||
my $asset = WebGUI::Asset->newById($self->session, $assetId);
|
||||
if (defined $asset) {
|
||||
unless ($asset->get("parentId") eq $self->getId) {
|
||||
$asset->setParent($self);
|
||||
|
|
|
|||
|
|
@ -711,7 +711,7 @@ sub getEvent {
|
|||
|
||||
# ? Perhaps use Stow to cache events ?
|
||||
|
||||
my $event = WebGUI::Asset->newByDynamicClass($self->session, $assetId);
|
||||
my $event = WebGUI::Asset->newById($self->session, $assetId);
|
||||
|
||||
unless ( $event ) {
|
||||
$self->session->errorHandler->warn("Event '$assetId' doesn't exist!");
|
||||
|
|
|
|||
|
|
@ -338,7 +338,7 @@ sub view {
|
|||
}
|
||||
}
|
||||
my $i = 1;
|
||||
my $templateAsset = WebGUI::Asset->newByDynamicClass($self->session, $templateId) || WebGUI::Asset->getImportNode($self->session);
|
||||
my $templateAsset = WebGUI::Asset->newById($self->session, $templateId) || WebGUI::Asset->getImportNode($self->session);
|
||||
my $template = $templateAsset->get("template");
|
||||
my $numPositions = 1;
|
||||
foreach my $j (2..15) {
|
||||
|
|
|
|||
|
|
@ -950,7 +950,7 @@ sub hasSpaceAvailable {
|
|||
} );
|
||||
|
||||
for my $assetId ( @{ $fileIds } ) {
|
||||
my $asset = WebGUI::Asset->newByDynamicClass( $self->session, $assetId );
|
||||
my $asset = WebGUI::Asset->newById( $self->session, $assetId );
|
||||
next unless $asset;
|
||||
$spaceUsed += $asset->get( 'assetSize' );
|
||||
|
||||
|
|
@ -976,7 +976,7 @@ sub prepareView {
|
|||
if ( $self->get("viewDefault") eq "album" && $self->get("viewAlbumAssetId") && $self->get("viewAlbumAssetId")
|
||||
ne 'PBasset000000000000001') {
|
||||
my $asset
|
||||
= WebGUI::Asset->newByDynamicClass( $self->session, $self->get("viewAlbumAssetId") );
|
||||
= WebGUI::Asset->newById( $self->session, $self->get("viewAlbumAssetId") );
|
||||
if ($asset) {
|
||||
$asset->prepareView;
|
||||
$self->{_viewAsset} = $asset;
|
||||
|
|
@ -1478,7 +1478,7 @@ sub www_search {
|
|||
|
||||
$p->appendTemplateVars( $var );
|
||||
for my $result ( @{ $p->getPageData } ) {
|
||||
my $asset = WebGUI::Asset->newByDynamicClass( $session, $result->{assetId} );
|
||||
my $asset = WebGUI::Asset->newById( $session, $result->{assetId} );
|
||||
push @{ $var->{search_results} }, {
|
||||
%{ $asset->getTemplateVars },
|
||||
isAlbum => $asset->isa( 'WebGUI::Asset::Wobject::GalleryAlbum' ),
|
||||
|
|
@ -1514,7 +1514,7 @@ sub www_listFilesForUser {
|
|||
# Get all the albums
|
||||
my $albumIds = $self->getUserAlbumIds( $userId );
|
||||
for my $albumId ( @$albumIds ) {
|
||||
my $asset = WebGUI::Asset->newByDynamicClass( $session, $albumId );
|
||||
my $asset = WebGUI::Asset->newById( $session, $albumId );
|
||||
push @{ $var->{user_albums} }, $asset->getTemplateVars;
|
||||
}
|
||||
|
||||
|
|
@ -1527,7 +1527,7 @@ sub www_listFilesForUser {
|
|||
$p->appendTemplateVars( $var );
|
||||
|
||||
for my $fileId ( @{ $p->getPageData } ) {
|
||||
my $asset = WebGUI::Asset->newByDynamicClass( $session, $fileId );
|
||||
my $asset = WebGUI::Asset->newById( $session, $fileId );
|
||||
push @{ $var->{user_files} }, $asset->getTemplateVars;
|
||||
}
|
||||
|
||||
|
|
@ -1556,7 +1556,7 @@ sub www_listFilesForUserRss {
|
|||
# Get all the albums
|
||||
my $albumIds = $self->getUserAlbumIds( $userId );
|
||||
for my $albumId ( @$albumIds ) {
|
||||
my $asset = WebGUI::Asset->newByDynamicClass( $session, $albumId );
|
||||
my $asset = WebGUI::Asset->newById( $session, $albumId );
|
||||
my $assetVar = $asset->getTemplateVars;
|
||||
|
||||
for my $key ( qw( url ) ) {
|
||||
|
|
@ -1569,7 +1569,7 @@ sub www_listFilesForUserRss {
|
|||
# Get all the files
|
||||
my $fileIds = $self->getUserFileIds( $userId );
|
||||
for my $fileId ( @$fileIds ) {
|
||||
my $asset = WebGUI::Asset->newByDynamicClass( $session, $fileId );
|
||||
my $asset = WebGUI::Asset->newById( $session, $fileId );
|
||||
my $assetVar = $asset->getTemplateVars;
|
||||
|
||||
for my $key ( qw( url ) ) {
|
||||
|
|
|
|||
|
|
@ -198,7 +198,7 @@ sub appendTemplateVarsFileLoop {
|
|||
my $session = $self->session;
|
||||
|
||||
for my $assetId (@$assetIds) {
|
||||
my $asset = WebGUI::Asset->newByDynamicClass($session, $assetId);
|
||||
my $asset = WebGUI::Asset->newById($session, $assetId);
|
||||
# Set the parent
|
||||
$asset->{_parent} = $self;
|
||||
push @{$var->{file_loop}}, $asset->getTemplateVars;
|
||||
|
|
@ -477,7 +477,7 @@ sub getNextAlbum {
|
|||
return $self->{_nextAlbum} if $self->{_nextAlbum};
|
||||
my $nextId = $self->getParent->getNextAlbumId( $self->getId );
|
||||
return undef unless $nextId;
|
||||
$self->{_nextAlbum } = WebGUI::Asset->newByDynamicClass( $self->session, $nextId );
|
||||
$self->{_nextAlbum } = WebGUI::Asset->newById( $self->session, $nextId );
|
||||
return $self->{_nextAlbum};
|
||||
}
|
||||
|
||||
|
|
@ -495,7 +495,7 @@ sub getPreviousAlbum {
|
|||
return $self->{_previousAlbum} if $self->{_previousAlbum};
|
||||
my $previousId = $self->getParent->getPreviousAlbumId( $self->getId );
|
||||
return undef unless $previousId;
|
||||
$self->{_previousAlbum} = WebGUI::Asset->newByDynamicClass( $self->session, $previousId );
|
||||
$self->{_previousAlbum} = WebGUI::Asset->newById( $self->session, $previousId );
|
||||
return $self->{_previousAlbum};
|
||||
}
|
||||
|
||||
|
|
@ -626,7 +626,7 @@ sub getThumbnailUrl {
|
|||
|
||||
# Try to get the asset
|
||||
if ( $self->get("assetIdThumbnail") ) {
|
||||
$asset = WebGUI::Asset->newByDynamicClass( $self->session, $self->get("assetIdThumbnail") );
|
||||
$asset = WebGUI::Asset->newById( $self->session, $self->get("assetIdThumbnail") );
|
||||
}
|
||||
elsif ( $self->getFirstChild ) {
|
||||
$asset = $self->getFirstChild;
|
||||
|
|
@ -720,7 +720,7 @@ sub processFileSynopsis {
|
|||
( my $assetId ) = $key =~ /^fileSynopsis_(.+)$/;
|
||||
my $synopsis = $form->get( $key );
|
||||
|
||||
my $asset = WebGUI::Asset->newByDynamicClass( $session, $assetId );
|
||||
my $asset = WebGUI::Asset->newById( $session, $assetId );
|
||||
if ( $asset->get("synopsis") ne $synopsis ) {
|
||||
my $properties = $asset->get;
|
||||
$properties->{ synopsis } = $synopsis;
|
||||
|
|
@ -878,7 +878,7 @@ sub view_thumbnails {
|
|||
# Add direct vars for the requested file
|
||||
my $asset;
|
||||
if ($fileId) {
|
||||
$asset = WebGUI::Asset->newByDynamicClass( $session, $fileId );
|
||||
$asset = WebGUI::Asset->newById( $session, $fileId );
|
||||
}
|
||||
# If no fileId given or fileId does not exist
|
||||
if (!$asset) {
|
||||
|
|
@ -1173,7 +1173,7 @@ sub www_edit {
|
|||
elsif ( grep { $_ =~ /^promote-(.{22})$/ } $form->param ) {
|
||||
my $assetId = ( grep { $_ =~ /^promote-(.{22})$/ } $form->param )[0];
|
||||
$assetId =~ s/^promote-//;
|
||||
my $asset = WebGUI::Asset->newByDynamicClass( $session, $assetId );
|
||||
my $asset = WebGUI::Asset->newById( $session, $assetId );
|
||||
if ( $asset ) {
|
||||
$asset->promote;
|
||||
}
|
||||
|
|
@ -1185,7 +1185,7 @@ sub www_edit {
|
|||
elsif ( grep { $_ =~ /^demote-(.{22})$/ } $form->param ) {
|
||||
my $assetId = ( grep { $_ =~ /^demote-(.{22})$/ } $form->param )[0];
|
||||
$assetId =~ s/^demote-//;
|
||||
my $asset = WebGUI::Asset->newByDynamicClass( $session, $assetId );
|
||||
my $asset = WebGUI::Asset->newById( $session, $assetId );
|
||||
if ( $asset ) {
|
||||
$asset->demote;
|
||||
}
|
||||
|
|
@ -1196,7 +1196,7 @@ sub www_edit {
|
|||
elsif ( grep { $_ =~ /^delete-(.{22})$/ } $form->param ) {
|
||||
my $assetId = ( grep { $_ =~ /^delete-(.{22})$/ } $form->param )[0];
|
||||
$assetId =~ s/^delete-//;
|
||||
my $asset = WebGUI::Asset->newByDynamicClass( $session, $assetId );
|
||||
my $asset = WebGUI::Asset->newById( $session, $assetId );
|
||||
if ( $asset ) {
|
||||
$asset->purge;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -394,7 +394,7 @@ ENDHTML
|
|||
ENDHTML
|
||||
|
||||
for my $pointId ( @{$pointIds} ) {
|
||||
my $point = WebGUI::Asset->newByDynamicClass( $session, $pointId );
|
||||
my $point = WebGUI::Asset->newById( $session, $pointId );
|
||||
next unless $point;
|
||||
$mapHtml .= sprintf ' points.push(%s);'."\n",
|
||||
JSON->new->encode($point->getMapInfo),
|
||||
|
|
@ -469,7 +469,7 @@ sub www_ajaxDeletePoint {
|
|||
my $session = $self->session;
|
||||
my $i18n = WebGUI::International->new( $session, 'Asset_Map' );
|
||||
my $assetId = $session->form->get('assetId');
|
||||
my $asset = WebGUI::Asset->newByDynamicClass( $session, $assetId );
|
||||
my $asset = WebGUI::Asset->newById( $session, $assetId );
|
||||
$session->http->setMimeType('application/json');
|
||||
return JSON->new->encode({error => $i18n->get('error delete unauthorized')})
|
||||
unless $asset && $asset->canEdit;
|
||||
|
|
@ -498,7 +498,7 @@ sub www_ajaxEditPoint {
|
|||
} );
|
||||
}
|
||||
else {
|
||||
$asset = WebGUI::Asset->newByDynamicClass( $session, $form->get('assetId') );
|
||||
$asset = WebGUI::Asset->newById( $session, $form->get('assetId') );
|
||||
}
|
||||
|
||||
my $output = $self->getEditPointTemplate->process( $asset->getTemplateVarsEditForm );
|
||||
|
|
@ -537,7 +537,7 @@ sub www_ajaxEditPointSave {
|
|||
} );
|
||||
}
|
||||
else {
|
||||
$asset = WebGUI::Asset->newByDynamicClass( $session, $assetId );
|
||||
$asset = WebGUI::Asset->newById( $session, $assetId );
|
||||
return JSON->new->encode({message => $i18n->get("error edit unauthorized")})
|
||||
unless $asset && $asset->canEdit;
|
||||
$asset = $asset->addRevision;
|
||||
|
|
@ -599,7 +599,7 @@ sub www_ajaxSetPointLocation {
|
|||
$session->http->setMimeType("application/json");
|
||||
|
||||
my $assetId = $form->get('assetId');
|
||||
my $asset = WebGUI::Asset->newByDynamicClass( $session, $assetId );
|
||||
my $asset = WebGUI::Asset->newById( $session, $assetId );
|
||||
return JSON->new->encode({message => $i18n->get("error edit unauthorized")})
|
||||
unless $asset && $asset->canEdit;
|
||||
$asset->update( {
|
||||
|
|
|
|||
|
|
@ -122,7 +122,7 @@ sub view {
|
|||
$first = $child;
|
||||
}
|
||||
my %lastPostVars;
|
||||
my $lastPost = WebGUI::Asset::Wobject::MessageBoard->newByDynamicClass($self->session, $child->get("lastPostId"));
|
||||
my $lastPost = WebGUI::Asset::Wobject::MessageBoard->newById($self->session, $child->get("lastPostId"));
|
||||
if (defined $lastPost) {
|
||||
%lastPostVars = (
|
||||
'forum.lastPost.url' => $lastPost->getUrl,
|
||||
|
|
|
|||
|
|
@ -532,7 +532,7 @@ sub getProjectInstance {
|
|||
return undef unless $projectId;
|
||||
my ($assetId) = $db->quickArray("select assetId from PM_project where projectId=?",[$projectId]);
|
||||
if($assetId) {
|
||||
return WebGUI::Asset->newByDynamicClass($session,$assetId);
|
||||
return WebGUI::Asset->newById($session,$assetId);
|
||||
}
|
||||
return undef;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -187,7 +187,7 @@ sub view {
|
|||
my %rules = (
|
||||
keywords =>$keywords,
|
||||
lineage =>[
|
||||
WebGUI::Asset->newByDynamicClass($session,$self->getValue("searchRoot"))->get("lineage")
|
||||
WebGUI::Asset->newById($session,$self->getValue("searchRoot"))->get("lineage")
|
||||
],
|
||||
);
|
||||
my @classes = split("\n",$self->get("classLimiter"));
|
||||
|
|
|
|||
|
|
@ -310,7 +310,7 @@ sub view {
|
|||
my @productIds = List::MoreUtils::uniq(@childSkus, @{$keywordBasedAssetIds});
|
||||
my @products = ();
|
||||
PRODUCT: foreach my $id (@productIds) {
|
||||
my $asset = WebGUI::Asset->newByDynamicClass($session, $id);
|
||||
my $asset = WebGUI::Asset->newById($session, $id);
|
||||
if (!defined $asset) {
|
||||
$session->errorHandler->error(q|Couldn't instanciate SKU with assetId |.$id.q| on shelf with assetId |.$self->getId);
|
||||
next PRODUCT;
|
||||
|
|
|
|||
|
|
@ -264,7 +264,7 @@ sub exportAssetCollateral {
|
|||
});
|
||||
my $listOfStories = [];
|
||||
STORYID: foreach my $storyId (@{ $storyIds }) {
|
||||
my $story = WebGUI::Asset->newByDynamicClass($session, $storyId);
|
||||
my $story = WebGUI::Asset->newById($session, $storyId);
|
||||
next STORYID unless $story;
|
||||
push @{ $listOfStories }, {
|
||||
title => $story->getTitle,
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@ sub getRssFeedItems {
|
|||
});
|
||||
my $storyData = [];
|
||||
STORY: foreach my $storyId (@{ $storyIds }) {
|
||||
my $story = WebGUI::Asset->newByDynamicClass($session, $storyId);
|
||||
my $story = WebGUI::Asset->newById($session, $storyId);
|
||||
next STORY unless $story;
|
||||
push @{ $storyData }, $story->getRssData;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -702,7 +702,7 @@ sub www_buildTimeTable {
|
|||
#Build project list and task lists from project management app
|
||||
my ($pmAssetId) = $db->quickArray("select a.assetId from PM_wobject a, asset b where a.assetId=b.assetId and b.state not like 'trash%'");
|
||||
if($pmAssetId) {
|
||||
$pmAsset = WebGUI::Asset->newByDynamicClass($session,$pmAssetId);
|
||||
$pmAsset = WebGUI::Asset->newById($session,$pmAssetId);
|
||||
my %pmProjectList = %{$pmAsset->getProjectList($user->userId)};
|
||||
%projectList = WebGUI::Utility::sortHash((%projectList,%pmProjectList));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -471,7 +471,7 @@ sub getRssFeedItems {
|
|||
$self->appendRecentChanges( $vars, $self->get('itemsPerFeed') );
|
||||
my $var = [];
|
||||
foreach my $item ( @{ $vars->{recentChanges} } ) {
|
||||
my $asset = WebGUI::Asset->newByDynamicClass( $self->session, $item->{assetId} );
|
||||
my $asset = WebGUI::Asset->newById( $self->session, $item->{assetId} );
|
||||
push @{ $var }, {
|
||||
'link' => $asset->getUrl,
|
||||
'guid' => $item->{ 'assetId' } . $asset->get( 'revisionDate' ),
|
||||
|
|
@ -597,7 +597,7 @@ sub view {
|
|||
# Get a random featured page
|
||||
my $featuredIds = $self->getFeaturedPageIds;
|
||||
my $featuredId = $featuredIds->[ int( rand @$featuredIds ) - 1 ];
|
||||
my $featured = WebGUI::Asset->newByDynamicClass( $session, $featuredId );
|
||||
my $featured = WebGUI::Asset->newById( $session, $featuredId );
|
||||
if ( $featured ) {
|
||||
$self->appendFeaturedPageVars( $var, $featured );
|
||||
}
|
||||
|
|
@ -628,7 +628,7 @@ sub www_byKeyword {
|
|||
});
|
||||
$p->setBaseUrl($self->getUrl("func=byKeyword;keyword=".$keyword));
|
||||
foreach my $assetData (@{$p->getPageData}) {
|
||||
my $asset = WebGUI::Asset->newByDynamicClass($self->session, $assetData->{assetId});
|
||||
my $asset = WebGUI::Asset->newById($self->session, $assetData->{assetId});
|
||||
next unless defined $asset;
|
||||
push(@pages, {
|
||||
title => $asset->getTitle,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue