Merge commit 'v7.10.18' into 8
Conflicts: docs/gotcha.txt docs/previousVersion.sql docs/templates.txt lib/WebGUI.pm lib/WebGUI/Asset/File.pm lib/WebGUI/Asset/Story.pm lib/WebGUI/Asset/Wobject/Calendar.pm lib/WebGUI/Asset/Wobject/Thingy.pm lib/WebGUI/AssetExportHtml.pm lib/WebGUI/Content/AssetManager.pm lib/WebGUI/Group.pm lib/WebGUI/Macro/AssetProxy.pm lib/WebGUI/Shop/PayDriver/PayPal/PayPalStd.pm lib/WebGUI/Storage.pm t/Asset/AssetExportHtml.t t/Asset/Story.t t/Shop/TaxDriver/Generic.t t/Storage.t
This commit is contained in:
commit
0c5acb697b
75 changed files with 979 additions and 139 deletions
|
|
@ -62,7 +62,7 @@ with 'WebGUI::Role::Asset::SetStoragePermissions';
|
|||
|
||||
use WebGUI::Storage;
|
||||
use WebGUI::SQL;
|
||||
|
||||
use WebGUI::Event;
|
||||
|
||||
=head1 NAME
|
||||
|
||||
|
|
@ -219,6 +219,7 @@ sub exportWriteFile {
|
|||
WebGUI::Error->throw(error => "can't copy " . $self->getStorageLocation->getPath($self->filename)
|
||||
. ' to ' . $dest->absolute->stringify . ": $!");
|
||||
}
|
||||
fire $self->session, 'asset::export' => $dest;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -254,14 +254,18 @@ Extends the base method to handle creating a new subscription group.
|
|||
=cut
|
||||
|
||||
sub duplicate {
|
||||
my $self = shift;
|
||||
my $session = $self->session;
|
||||
my $copy = $self->SUPER::duplicate(@_);
|
||||
if ($self->get('subscriptionGroupId')) {
|
||||
my $group = WebGUI::Group->new($session, $self->get('subscriptionGroupId'));
|
||||
my $copied_group = WebGUI::Group->new($session, 'new');
|
||||
$copied_group->addUsers($group->getUsers('withoutExpired'));
|
||||
$copy->update({subscriptionGroupId => $copied_group->getId});
|
||||
my $self = shift;
|
||||
my $session = $self->session;
|
||||
my $copy = $self->SUPER::duplicate(@_);
|
||||
my $oldGroupId = $self->get('subscriptionGroupId');
|
||||
|
||||
if ($oldGroupId) {
|
||||
my $newGroup = WebGUI::Group->new($session, 'new');
|
||||
my $oldGroup = WebGUI::Group->new($session, $oldGroupId);
|
||||
if ($oldGroup) {
|
||||
$newGroup->addUsers($oldGroup->getUsers('withoutExpired'));
|
||||
}
|
||||
$copy->update({subscriptionGroupId => $newGroup->getId});
|
||||
}
|
||||
return $copy;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -73,8 +73,6 @@ with 'WebGUI::Role::Asset::AlwaysHidden';
|
|||
|
||||
use WebGUI::International;
|
||||
use JSON qw/from_json to_json/;
|
||||
use Storable qw/dclone/;
|
||||
use Data::Dumper;
|
||||
|
||||
=head1 NAME
|
||||
|
||||
|
|
@ -513,12 +511,10 @@ Returns the photo hash formatted as perl data. See also L<setPhotoData>.
|
|||
|
||||
sub getPhotoData {
|
||||
my $self = shift;
|
||||
if (!exists $self->{_photoData}) {
|
||||
my $json = $self->photo;
|
||||
$json ||= '[]';
|
||||
$self->{_photoData} = from_json($json);
|
||||
}
|
||||
return dclone($self->{_photoData});
|
||||
my $json = $self->photo;
|
||||
$json ||= '[]';
|
||||
my $photoData = from_json($json);
|
||||
return $photoData;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -600,8 +596,6 @@ sub processEditForm {
|
|||
my $session = $self->session;
|
||||
$self->next::method;
|
||||
my $archive = delete $self->{_parent}; ##Force a new lookup.
|
||||
#$session->log->warn($self->getParent->get('className'));
|
||||
#$session->log->warn($self->getParent->getParent->get('className'));
|
||||
my $form = $session->form;
|
||||
##Handle old data first, to avoid iterating across a newly added photo.
|
||||
my $photoData = $self->getPhotoData;
|
||||
|
|
@ -773,7 +767,6 @@ sub setPhotoData {
|
|||
my $photo = to_json($photoData);
|
||||
##Update the db.
|
||||
$self->update({photo => $photo});
|
||||
delete $self->{_photoData};
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -705,7 +705,8 @@ sub getFeed {
|
|||
|
||||
=head2 getFeeds ( )
|
||||
|
||||
Gets an arrayref of hashrefs of all the feeds attached to this calendar.
|
||||
Gets an arrayref of hashrefs of all the feeds attached to this calendar. Since the icalFeeds
|
||||
property does double duty as JSON and Perl, deserialize from JSON if it's not already perl.
|
||||
|
||||
TODO: Format lastUpdated into the user's time zone
|
||||
|
||||
|
|
@ -713,7 +714,10 @@ TODO: Format lastUpdated into the user's time zone
|
|||
|
||||
sub getFeeds {
|
||||
my $self = shift;
|
||||
return $self->icalFeeds;
|
||||
my $feeds = $self->icalFeeds;
|
||||
return $feeds if (ref $feeds);
|
||||
$self->session->log->warn('improperly stored icalFeed in calendar assetId:'.$self->getId);
|
||||
return JSON::from_json($feeds);
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -2075,7 +2075,7 @@ sub www_editThing {
|
|||
maxEntriesPerUser=>undef,
|
||||
maxEntriesTotal=>undef,
|
||||
);
|
||||
$thingId = $self->addThing(\%properties,0);
|
||||
$thingId = "new";
|
||||
}
|
||||
else{
|
||||
%properties = %{$self->getThing($thingId)};
|
||||
|
|
@ -2600,13 +2600,14 @@ sub www_editFieldSave {
|
|||
$defaultValue = $session->form->process("defaultFieldInThing");
|
||||
}
|
||||
|
||||
$thingId = $self->addThing({ thingId => 'new' },0) if $thingId eq 'new';
|
||||
$fieldId = $session->form->process("fieldId");
|
||||
%properties = (
|
||||
fieldId => $fieldId,
|
||||
thingId => $thingId,
|
||||
label => $label,
|
||||
fieldType => $fieldType,
|
||||
isUnique => $uniqueField,
|
||||
isUnique => $uniqueField,
|
||||
defaultValue => $defaultValue,
|
||||
possibleValues => $session->form->process("possibleValues"),
|
||||
pretext => $session->form->process("pretext"),
|
||||
|
|
@ -2664,7 +2665,7 @@ sub www_editFieldSave {
|
|||
# Make sure we send debug information along with the field.
|
||||
$log->preventDebugOutput;
|
||||
|
||||
$session->output->print($newFieldId.$listItemHTML);
|
||||
$session->output->print($thingId.$newFieldId.$listItemHTML);
|
||||
return "chunked";
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue