mirror of
https://github.com/humhub/humhub.git
synced 2025-01-16 21:58:17 +01:00
Fix unknown streamQuery
on load Filter
(#5845)
* Fix unknown `streamQuery` on load `Filter` * Fix unknown `streamQuery` on load `Filter` * Update CHANGELOG.md (#5845) * Fix unknown `streamQuery` on load `Filter`
This commit is contained in:
parent
d66d706f75
commit
c577bf5fc6
@ -9,6 +9,7 @@ HumHub Changelog
|
||||
- Fix #5814: Fix numerated lists in mail summary content
|
||||
- Fix #5830: Fix cron job of search index rebuilding
|
||||
- Fix #5838: Fix deprecated null value for `file_exists()` on PHP 8.1
|
||||
- Fix #5845: Fix unknown `streamQuery` on load `Filter`
|
||||
|
||||
1.12.0 (July 27, 2022)
|
||||
----------------------
|
||||
|
@ -25,6 +25,18 @@ abstract class StreamQueryFilter extends QueryFilter
|
||||
*/
|
||||
public $autoLoad = self::AUTO_LOAD_GET;
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function init()
|
||||
{
|
||||
parent::init();
|
||||
|
||||
if ($this->isLoaded && !parent::validate()) {
|
||||
$this->streamQuery->addErrors($this->getErrors());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
@ -32,4 +44,5 @@ abstract class StreamQueryFilter extends QueryFilter
|
||||
{
|
||||
return $this->formName ?: 'StreamQuery';
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -28,6 +28,11 @@ abstract class Filter extends Model
|
||||
*/
|
||||
public $autoLoad = self::AUTO_LOAD_ALL;
|
||||
|
||||
/**
|
||||
* @var bool True - if data was loaded at least one time
|
||||
*/
|
||||
protected $isLoaded = false;
|
||||
|
||||
public abstract function apply();
|
||||
|
||||
public function init() {
|
||||
@ -35,7 +40,7 @@ abstract class Filter extends Model
|
||||
return;
|
||||
}
|
||||
|
||||
if($this->autoLoad === static::AUTO_LOAD_ALL) {
|
||||
if ($this->autoLoad === static::AUTO_LOAD_ALL) {
|
||||
$this->load(Yii::$app->request->get());
|
||||
$this->load(Yii::$app->request->post());
|
||||
} elseif($this->autoLoad === static::AUTO_LOAD_GET) {
|
||||
@ -45,24 +50,21 @@ abstract class Filter extends Model
|
||||
}
|
||||
}
|
||||
|
||||
public function formName() {
|
||||
return $this->formName ?: parent::formName();
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
* @inheridoc
|
||||
*/
|
||||
public function load($data, $formName = null)
|
||||
{
|
||||
if (!parent::load($data, $formName)) {
|
||||
return false;
|
||||
if (parent::load($data, $formName)) {
|
||||
$this->isLoaded = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!parent::validate()) {
|
||||
$this->streamQuery->addErrors($this->getErrors());
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public function formName() {
|
||||
return $this->formName ? $this->formName : parent::formName();
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user