Enh: When moving a content from a container to another, prevent updat… (#6986)

* Enh: When moving a content from a container to another, prevent updating the content dates to keep the stream sort as it was

* Add PR ID to changelog
This commit is contained in:
Marc Farré 2024-05-02 12:20:13 +02:00 committed by GitHub
parent 0dab6f67f0
commit e637315392
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 1 deletions

View File

@ -20,6 +20,7 @@ HumHub Changelog
- Fix #6977: Index sub comments for searching
- Fix #6978: Fix module enabling from marketplace
- Enh #6984: In forms, change checkbox style to match other input types
- Enh #6986: When moving a content from a container to another, prevent updating the content dates to keep the stream sort as it was
1.16.0-beta.2 (April 9, 2024)
-----------------------------

View File

@ -630,7 +630,7 @@ class Content extends ActiveRecord implements Movable, ContentOwner, Archiveable
if ($move === true) {
static::getDb()->transaction(function ($db) use ($container) {
$this->setContainer($container);
if ($this->save()) {
if ($this->updateAttributes(['contentcontainer_id', 'visibility'])) {
ContentTag::deleteContentRelations($this, false);
$model = $this->getModel();
$model->populateRelation('content', $this);