mirror of
https://github.com/humhub/humhub.git
synced 2025-01-17 14:18:27 +01:00
Merge branch 'master' into develop
This commit is contained in:
commit
4948b3f0c3
@ -1,6 +1,11 @@
|
|||||||
HumHub Changelog
|
HumHub Changelog
|
||||||
================
|
================
|
||||||
|
|
||||||
|
1.14.1 (Unreleased)
|
||||||
|
-------------------
|
||||||
|
- Fix #6251: Emulate execution on `readable()` content
|
||||||
|
- Enh #6252: Implement new method to handle changing of content active record state
|
||||||
|
|
||||||
1.14.0 (April 20, 2023)
|
1.14.0 (April 20, 2023)
|
||||||
-----------------------
|
-----------------------
|
||||||
- Fix #6196: Use class names for default logging targets in default common config
|
- Fix #6196: Use class names for default logging targets in default common config
|
||||||
|
@ -113,7 +113,7 @@ class ActiveQueryContent extends ActiveQuery
|
|||||||
$conditionUser = 'cuser.id IS NOT NULL and cuser.visibility=' . User::VISIBILITY_ALL . ' AND content.visibility=1';
|
$conditionUser = 'cuser.id IS NOT NULL and cuser.visibility=' . User::VISIBILITY_ALL . ' AND content.visibility=1';
|
||||||
$globalCondition .= 'content.contentcontainer_id IS NULL AND content.visibility=1';
|
$globalCondition .= 'content.contentcontainer_id IS NULL AND content.visibility=1';
|
||||||
} else {
|
} else {
|
||||||
$this->emulateExecution();
|
return $this->emulateExecution();
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->andWhere("{$conditionSpace} OR {$conditionUser} OR {$globalCondition}");
|
$this->andWhere("{$conditionSpace} OR {$conditionUser} OR {$globalCondition}");
|
||||||
|
@ -454,6 +454,16 @@ class ContentActiveRecord extends ActiveRecord implements ContentOwner, Movable,
|
|||||||
parent::afterSave($insert, $changedAttributes);
|
parent::afterSave($insert, $changedAttributes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This method is called after state of the Content of this Active Record has been changed
|
||||||
|
*
|
||||||
|
* @param int|null $newState
|
||||||
|
* @param int|null $previousState
|
||||||
|
*/
|
||||||
|
public function afterStateChange(?int $newState, ?int $previousState): void
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the class used in the polymorphic content relation.
|
* Returns the class used in the polymorphic content relation.
|
||||||
* By default this function will return the static class.
|
* By default this function will return the static class.
|
||||||
|
@ -244,12 +244,20 @@ class Content extends ActiveRecord implements Movable, ContentOwner, SoftDeletab
|
|||||||
$changedAttributes['state'] == Content::STATE_DRAFT
|
$changedAttributes['state'] == Content::STATE_DRAFT
|
||||||
)) {
|
)) {
|
||||||
$this->processNewContent();
|
$this->processNewContent();
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($insert || array_key_exists('state', $changedAttributes)) {
|
||||||
|
$previousState = $changedAttributes['state'] ?? null;
|
||||||
$this->trigger(self::EVENT_STATE_CHANGED, new ContentStateEvent([
|
$this->trigger(self::EVENT_STATE_CHANGED, new ContentStateEvent([
|
||||||
'content' => $this,
|
'content' => $this,
|
||||||
'newState' => $this->state,
|
'newState' => $this->state,
|
||||||
'previousState' => (isset($changedAttributes['state'])) ? $changedAttributes['state'] : null,
|
'previousState' => $previousState
|
||||||
]));
|
]));
|
||||||
|
|
||||||
|
$model = $this->getPolymorphicRelation();
|
||||||
|
if ($model instanceof ContentActiveRecord) {
|
||||||
|
$model->afterStateChange($this->state, $previousState);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->state === static::STATE_PUBLISHED) {
|
if ($this->state === static::STATE_PUBLISHED) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user