diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 972c0d1a8..67ab19d59 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -25,6 +25,10 @@ - fixed #10925: Wrong message in i18n - relabel Help in the Admin Console to Template Help - fixed #10928: EMS Print Ticket -- Time not processed for timezone + - fixed #10889: Old Matrixs break for Admin users + - fixed #10939: Commit with Approval workflow does not show confirmation screen + - fixed #10862: Version tag contents page + - fixed #10943: ThingyRecord JS Broken - added Subscribable AssetAspect to Wiki 7.7.19 diff --git a/docs/upgrades/upgrade_7.7.19-7.8.0.pl b/docs/upgrades/upgrade_7.7.19-7.8.0.pl index c7c757ade..68e6d498a 100644 --- a/docs/upgrades/upgrade_7.7.19-7.8.0.pl +++ b/docs/upgrades/upgrade_7.7.19-7.8.0.pl @@ -34,6 +34,7 @@ my $session = start(); # this line required reorganizeAdSpaceProperties($session); fixTemplateSettingsFromShunt($session); addSubscribableAspect( $session ); +addMatrixColumnDefaults($session); finish($session); # this line required @@ -79,6 +80,18 @@ sub reorganizeAdSpaceProperties { print "DONE!\n" unless $quiet; } +#---------------------------------------------------------------------------- +# Describe what our function does +sub addMatrixColumnDefaults { + my $session = shift; + print "\tUpdate existing Matrixes with default values for maxComparisons... " unless $quiet; + $session->db->write(q|UPDATE Matrix set maxComparisons=25 where maxComparisons IS NULL|); + $session->db->write(q|UPDATE Matrix set maxComparisonsGroup=25 where maxComparisonsGroup IS NULL|); + $session->db->write(q|UPDATE Matrix set maxComparisonsPrivileged=25 where maxComparisonsPrivileged IS NULL|); + # and here's our code + print "DONE!\n" unless $quiet; +} + sub fixTemplateSettingsFromShunt { my $session = shift; print "\tClear isPackage and set isDefault on recently imported templates... " unless $quiet; diff --git a/lib/WebGUI/Asset.pm b/lib/WebGUI/Asset.pm index de15930f6..6c92f4657 100644 --- a/lib/WebGUI/Asset.pm +++ b/lib/WebGUI/Asset.pm @@ -346,6 +346,26 @@ sub checkView { #------------------------------------------------------------------- +=head2 cloneFromDb ( ) + +Fetches a new fresh clone of this object from the database. Often used after +calling commit on version tags. + +Returns the new Asset object. + +=cut + +sub cloneFromDb { + my $self = shift; + return WebGUI::Asset->new($self->session, + $self->getId, + $self->get('className'), + $self->get('revisionDate') + ); +} + +#------------------------------------------------------------------- + =head2 definition ( session, [ definition ] ) Basic definition of an Asset. Properties, default values. Returns an array reference containing tableName,className,properties @@ -2784,11 +2804,12 @@ sub www_editSave { $object->updateHistory("edited"); # we handle auto commit assets here in case they didn't handle it themselves + $session->log->warn('pre object isa'. ref $object); if ($object->getAutoCommitWorkflowId) { + $session->log->warn('got autocommit workflow id'); $object->requestAutoCommit; #Since the version tag makes new objects, fetch a fresh one here. - #Note, this workaround can still fail, if WebGUI hands off back to spectre. - $object = WebGUI::Asset->new($session, $object->getId, $object->get('className')); + $object = $object->cloneFromDb; } # else, try to to auto commit else { @@ -2804,9 +2825,10 @@ sub www_editSave { elsif ($commitStatus eq 'commit') { ##Commit was successful. Update the local object cache so that it will no longer ##register as locked. - $self->{_properties}{isLockedBy} = $object->{_properties}{isLockedBy} = undef; + $object = $object->cloneFromDb; } } + $session->log->warn('post object isa'. ref $object); # Handle "saveAndReturn" button if ( $session->form->process( "saveAndReturn" ) ne "" ) { @@ -2814,23 +2836,23 @@ sub www_editSave { } # Handle "proceed" form parameter - my $proceed = $self->session->form->process('proceed'); + my $proceed = $session->form->process('proceed'); if ($proceed eq "manageAssets") { - $self->session->asset($object->getParent); - return $self->session->asset->www_manageAssets; + $session->asset($object->getParent); + return $session->asset->www_manageAssets; } elsif ($proceed eq "viewParent") { - $self->session->asset($object->getParent); - return $self->session->asset->www_view; + $session->asset($object->getParent); + return $session->asset->www_view; } - elsif ($proceed eq "goBackToPage" && $self->session->form->process('returnUrl')) { - $self->session->http->setRedirect($self->session->form->process("returnUrl")); + elsif ($proceed eq "goBackToPage" && $session->form->process('returnUrl')) { + $session->http->setRedirect($session->form->process("returnUrl")); return undef; } elsif ($proceed ne "") { - my $method = "www_".$self->session->form->process("proceed"); - $self->session->asset($object); - return $self->session->asset->$method(); + my $method = "www_".$session->form->process("proceed"); + $session->asset($object); + return $session->asset->$method(); } $session->asset($object->getContainer); diff --git a/lib/WebGUI/Asset/Sku/ThingyRecord.pm b/lib/WebGUI/Asset/Sku/ThingyRecord.pm index 4faeee448..391759182 100644 --- a/lib/WebGUI/Asset/Sku/ThingyRecord.pm +++ b/lib/WebGUI/Asset/Sku/ThingyRecord.pm @@ -206,7 +206,7 @@ sub drawEditFieldPrice { my ( $self ) = @_; my $fieldHtml = sprintf <<'ENDHTML', encode_entities( $self->get('fieldPrice') ); -
+ ENDHTML return $fieldHtml; diff --git a/lib/WebGUI/Asset/Template.pm b/lib/WebGUI/Asset/Template.pm index 67bf4aa21..798ebf0bc 100644 --- a/lib/WebGUI/Asset/Template.pm +++ b/lib/WebGUI/Asset/Template.pm @@ -889,9 +889,9 @@ sub www_editDuplicate { # Auto-commit our revision if necessary # TODO: This needs to be handled automatically somehow... my $status = WebGUI::VersionTag->autoCommitWorkingIfEnabled($self->session); - ##Force the locked by tag + ##get a fresh object from the database if ($status eq 'commit') { - $newTemplate->{_properties}{isLockedBy} = undef; + $newTemplate = $newTemplate->cloneFromDb; } last DEF; } diff --git a/lib/WebGUI/Asset/Wobject/Matrix.pm b/lib/WebGUI/Asset/Wobject/Matrix.pm index 13ed6b3cc..fa65ae3a8 100644 --- a/lib/WebGUI/Asset/Wobject/Matrix.pm +++ b/lib/WebGUI/Asset/Wobject/Matrix.pm @@ -472,7 +472,8 @@ sub getCompareForm { } else{ $maxComparisons = $self->get('maxComparisonsPrivileged'); - } + } + $maxComparisons += 0; $form .= "\n