fix shortcuts not copying overrides with asset or removing them on purge
This commit is contained in:
parent
20e496d002
commit
b725e93f35
2 changed files with 23 additions and 0 deletions
|
|
@ -11,6 +11,7 @@
|
||||||
7.4.14
|
7.4.14
|
||||||
- fix: CS posts won't allow new attachments after deleting an old one
|
- fix: CS posts won't allow new attachments after deleting an old one
|
||||||
- fix: SSL redirection broken
|
- fix: SSL redirection broken
|
||||||
|
- fix: Shortcut overrides not copied with asset or removed on purge
|
||||||
|
|
||||||
7.4.13
|
7.4.13
|
||||||
- fix: field_loop missing from SQL Form template
|
- fix: field_loop missing from SQL Form template
|
||||||
|
|
|
||||||
|
|
@ -207,6 +207,19 @@ sub discernUserId {
|
||||||
return ($self->canManage && $self->session->var->isAdminOn) ? '1' : $self->session->user->userId;
|
return ($self->canManage && $self->session->var->isAdminOn) ? '1' : $self->session->user->userId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------
|
||||||
|
sub duplicate {
|
||||||
|
my $self = shift;
|
||||||
|
my $newAsset = $self->SUPER::duplicate(@_);
|
||||||
|
$self->session->db->write(<<'END_SQL', [$newAsset->getId, $self->getId]);
|
||||||
|
INSERT INTO Shortcut_overrides (assetId, fieldName, newValue)
|
||||||
|
SELECT ?, fieldName, newValue
|
||||||
|
FROM Shortcut_overrides
|
||||||
|
WHERE assetId = ?
|
||||||
|
END_SQL
|
||||||
|
return $newAsset;
|
||||||
|
}
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
sub getEditForm {
|
sub getEditForm {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
|
@ -636,7 +649,16 @@ sub processPropertiesFromFormPost {
|
||||||
}
|
}
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
sub purge {
|
||||||
|
my $self = shift;
|
||||||
|
$self->session->db->write(<<'END_SQL', [$self->getId]);
|
||||||
|
DELETE FROM Shortcut_overrides
|
||||||
|
WHERE assetId = ?
|
||||||
|
END_SQL
|
||||||
|
return $self->SUPER::purge(@_);
|
||||||
|
}
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------
|
||||||
sub uncacheOverrides {
|
sub uncacheOverrides {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
WebGUI::Cache->new($self->session,$self->_overridesCacheTag)->delete;
|
WebGUI::Cache->new($self->session,$self->_overridesCacheTag)->delete;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue