Change newByDynamicClass calls that creept in back to newById, except for the ones in doc/upgrade. Kinda important.
This commit is contained in:
parent
57d2dbed56
commit
96bb194402
8 changed files with 11 additions and 11 deletions
|
|
@ -1127,7 +1127,7 @@ sub www_emailRecoverPasswordFinish {
|
|||
my $mail = WebGUI::Mail::Send->create($session, { to=>$email, subject=>$i18n->get('WebGUI password recovery')});
|
||||
my $vars = { };
|
||||
$vars->{recoverPasswordUrl} = $session->url->append($session->url->getSiteURL,'op=auth;method=emailResetPassword;token='.$recoveryGuid);
|
||||
my $template = WebGUI::Asset->newByDynamicClass($session, $session->setting->get('webguiPasswordRecoveryEmailTemplate'));
|
||||
my $template = WebGUI::Asset->newById($session, $session->setting->get('webguiPasswordRecoveryEmailTemplate'));
|
||||
my $emailText = $template->process($vars);
|
||||
WebGUI::Macro::process($session, \$emailText);
|
||||
$mail->addText($emailText);
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ sub execute {
|
|||
comments => $versionTag->get('comments'),
|
||||
url => $urlOfSingleAsset,
|
||||
};
|
||||
my $template = WebGUI::Asset->newByDynamicClass($self->session, $self->get('templateId'));
|
||||
my $template = WebGUI::Asset->newById($self->session, $self->get('templateId'));
|
||||
my $message = $template->process($var);
|
||||
my $properties = {
|
||||
status=>"completed",
|
||||
|
|
|
|||
|
|
@ -295,7 +295,7 @@ sub sendMessage {
|
|||
comments => $versionTag->get('comments'),
|
||||
url => $approvalUrl,
|
||||
};
|
||||
my $template = WebGUI::Asset->newByDynamicClass($self->session, $self->get('templateId'));
|
||||
my $template = WebGUI::Asset->newById($self->session, $self->get('templateId'));
|
||||
my $messageText = $template->process($var);
|
||||
for my $groupId ( @{ $self->getGroupToApprove } ) {
|
||||
my $message
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ sub du {
|
|||
my $totalSize; # disk space used
|
||||
|
||||
if ($assetId) { # They specified an assetId to start with
|
||||
$asset = WebGUI::Asset->newByDynamicClass($session,$assetId);
|
||||
$asset = WebGUI::Asset->newById($session,$assetId);
|
||||
die ("Unable to instanciate asset $assetId") unless defined $asset;
|
||||
print "\nStarting with asset $assetId...\n" unless $quiet;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -104,8 +104,8 @@ while ( my %row = $sth->hash ) {
|
|||
print "Fixed.\n";
|
||||
|
||||
# Make sure we have a valid parent
|
||||
unless ( WebGUI::Asset->newByDynamicClass( $session, $row{parentId} ) ) {
|
||||
my $asset = WebGUI::Asset->newByDynamicClass( $session, $row{assetId} );
|
||||
unless ( WebGUI::Asset->newById( $session, $row{parentId} ) ) {
|
||||
my $asset = WebGUI::Asset->newById( $session, $row{assetId} );
|
||||
$asset->setParent( WebGUI::Asset->getImportNode( $session ) );
|
||||
print "\tNOTE: Invalid parent. Asset moved to Import Node\n";
|
||||
}
|
||||
|
|
@ -136,7 +136,7 @@ while ( my %row = $sth->hash ) {
|
|||
printf "%10s: %s\n", "class", $row{className};
|
||||
|
||||
# Parent
|
||||
if ( my $parent = WebGUI::Asset->newByDynamicClass( $session, $row{parentId} ) ) {
|
||||
if ( my $parent = WebGUI::Asset->newById( $session, $row{parentId} ) ) {
|
||||
printf "%10s: %s (%s)\n", "parent", $parent->getTitle, $parent->getId;
|
||||
}
|
||||
elsif ( $session->db->quickScalar( "SELECT * FROM asset WHERE assetId=?", [$row{parentId}] ) ) {
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ if ( $gallery && $gallery->isa('WebGUI::Asset::Wobject::Gallery') ) {
|
|||
else {
|
||||
my $fromAsset = undef;
|
||||
if (defined $fromAssetId) {
|
||||
$fromAsset = WebGUI::Asset->newByDynamicClass($session, $fromAssetId);
|
||||
$fromAsset = WebGUI::Asset->newById($session, $fromAssetId);
|
||||
}
|
||||
else {
|
||||
$fromAsset = WebGUI::Asset->newByUrl($session, $fromAssetUrl);
|
||||
|
|
@ -241,7 +241,7 @@ sub addAlbumFromFolder {
|
|||
} );
|
||||
|
||||
for my $fileId ( @{ $fileIds } ) {
|
||||
my $oldFile = WebGUI::Asset->newByDynamicClass( $session, $fileId );
|
||||
my $oldFile = WebGUI::Asset->newById( $session, $fileId );
|
||||
my $oldStorage = $oldFile->getStorageLocation;
|
||||
my $className = $gallery->getAssetClassForFile( $oldStorage->getPath( $oldFile->get('filename') ) );
|
||||
if ( !$className ) {
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ if ($url) {
|
|||
$asset = WebGUI::Asset->newByUrl($session,$url);
|
||||
}
|
||||
else {
|
||||
$asset = WebGUI::Asset->newByDynamicClass($session,$assetId);
|
||||
$asset = WebGUI::Asset->newById($session,$assetId);
|
||||
}
|
||||
|
||||
if (defined $asset) {
|
||||
|
|
|
|||
|
|
@ -148,7 +148,7 @@ $mech->submit_form_ok({
|
|||
},
|
||||
'Submit Photo edit form' );
|
||||
# Re-create instance of Photo asset
|
||||
$photo = WebGUI::Asset->newByDynamicClass($session, $photo->getId);
|
||||
$photo = WebGUI::Asset->newById($session, $photo->getId);
|
||||
# Check whether properties were changed correctly
|
||||
cmp_deeply($photo->get, superhashof(\%properties), 'All changes applied');
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue