mirror of
https://github.com/processwire/processwire.git
synced 2025-08-24 15:23:11 +02:00
Update FieldtypeDatetime to support empty/not-empty operators in InputfieldSelector
This commit is contained in:
@@ -279,7 +279,7 @@ class FieldtypeDatetime extends Fieldtype {
|
|||||||
*/
|
*/
|
||||||
public function ___getSelectorInfo(Field $field, array $data = array()) {
|
public function ___getSelectorInfo(Field $field, array $data = array()) {
|
||||||
$a = parent::___getSelectorInfo($field, $data);
|
$a = parent::___getSelectorInfo($field, $data);
|
||||||
$a['operators'] = array('=', '!=', '>', '>=', '<', '<=', '%=', '^=');
|
$a['operators'] = array('=', '!=', '>', '>=', '<', '<=', '%=', '^=', '=""', '!=""');
|
||||||
return $a;
|
return $a;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -963,7 +963,7 @@ class InputfieldFile extends Inputfield implements InputfieldItemList, Inputfiel
|
|||||||
$sort = $input->$key;
|
$sort = $input->$key;
|
||||||
if($sort !== null) {
|
if($sort !== null) {
|
||||||
$sort = (int) $sort;
|
$sort = (int) $sort;
|
||||||
$pagefile->sort = $sort;
|
$pagefile->set('sort', $sort);
|
||||||
if($n !== $sort) $changed = true;
|
if($n !== $sort) $changed = true;
|
||||||
$saveFields = true;
|
$saveFields = true;
|
||||||
}
|
}
|
||||||
@@ -982,6 +982,8 @@ class InputfieldFile extends Inputfield implements InputfieldItemList, Inputfiel
|
|||||||
} else if(!$this->isAjax && !$this->overwrite && $pagefile->isTemp() && $sort !== null) {
|
} else if(!$this->isAjax && !$this->overwrite && $pagefile->isTemp() && $sort !== null) {
|
||||||
// if page saved with temporary items when not ajax, those temporary items become non-temp
|
// if page saved with temporary items when not ajax, those temporary items become non-temp
|
||||||
$pagefile->isTemp(false);
|
$pagefile->isTemp(false);
|
||||||
|
// @todo should the next statement instead be this below?
|
||||||
|
// if($this->maxFiles > 0) while(count($this->value) > $this->>maxFiles) { ... } ?
|
||||||
if($this->maxFiles == 1) while(count($this->value) > 1) {
|
if($this->maxFiles == 1) while(count($this->value) > 1) {
|
||||||
$item = $this->value->first();
|
$item = $this->value->first();
|
||||||
$this->value->remove($item);
|
$this->value->remove($item);
|
||||||
|
Reference in New Issue
Block a user