Merge commit 'v7.10.20' into WebGUI8
This commit is contained in:
commit
fdb979ca8a
72 changed files with 830 additions and 224 deletions
|
|
@ -1516,12 +1516,16 @@ Extend the base method to handle cleaning up storage locations.
|
|||
|
||||
override purge => sub {
|
||||
my $self = shift;
|
||||
my $sth = $self->session->db->read("select storageId from Post where assetId=".$self->session->db->quote($self->getId));
|
||||
while (my ($storageId) = $sth->array) {
|
||||
my $storage = WebGUI::Storage->get($self->session, $storageId);
|
||||
$storage->delete if defined $storage;
|
||||
my $purged = super();
|
||||
if ($purged) {
|
||||
my $sth = $self->session->db->read("select storageId from Post where assetId=?",[$self->getId]);
|
||||
while (my ($storageId) = $sth->array) {
|
||||
my $storage = WebGUI::Storage->get($self->session, $storageId);
|
||||
$storage->delete if defined $storage;
|
||||
}
|
||||
$sth->finish;
|
||||
$self->disqualifyAsLastPost;
|
||||
}
|
||||
$sth->finish;
|
||||
return super();
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -1037,18 +1037,22 @@ sub getFieldValue {
|
|||
my $dateFormat = shift || "%z";
|
||||
my $dateTimeFormat = shift;
|
||||
my $processedValue = $value;
|
||||
my $dbh = $self->session->db->dbh;
|
||||
my $session = $self->session;
|
||||
my $dbh = $session->db->dbh;
|
||||
|
||||
if (lc $field->{fieldType} eq "date"){
|
||||
$processedValue = $self->session->datetime->epochToHuman($value,$dateFormat);
|
||||
my $fieldType = lc $field->{fieldType};
|
||||
if ($fieldType eq "date"){
|
||||
my $dt = WebGUI::DateTime->new($session, $value);
|
||||
$processedValue = $dt->webguiDate($dateFormat);
|
||||
}
|
||||
elsif (lc $field->{fieldType} eq "datetime"){
|
||||
$processedValue = $self->session->datetime->epochToHuman($value,$dateTimeFormat);
|
||||
elsif ($fieldType eq "datetime"){
|
||||
my $dt = WebGUI::DateTime->new($session, $value);
|
||||
$processedValue = $dt->webguiDate($dateTimeFormat);
|
||||
}
|
||||
# TODO: The otherThing field type is probably also handled by getFormPlugin, so the elsif below can probably be
|
||||
# safely removed. However, this requires more testing than I can provide right now, so for now this stays the
|
||||
# way it was.
|
||||
elsif ($field->{fieldType} =~ m/^otherThing/x) {
|
||||
elsif ($field->{fieldType} =~ m/^otherthing/x) {
|
||||
my $otherThingId = $field->{fieldType};
|
||||
$otherThingId =~ s/^otherThing_//x;
|
||||
my $tableName = 'Thingy_'.$otherThingId;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue