mirror of
https://github.com/processwire/processwire.git
synced 2025-08-22 22:34:15 +02:00
Various minor adjustments
This commit is contained in:
@@ -90,6 +90,7 @@ class FieldtypeImage extends FieldtypeFile {
|
||||
}
|
||||
$variations = array();
|
||||
foreach($img->getVariations() as $variation) {
|
||||
/** @var Pageimage $variation */
|
||||
$variations[$variation->name] = $variation->httpUrl();
|
||||
}
|
||||
$value[$k]['variations'] = $variations;
|
||||
|
@@ -599,9 +599,18 @@ class FieldtypePage extends FieldtypeMulti implements Module, ConfigurableModule
|
||||
if(InputfieldPage::isValidPage($value, $field, $forPage)) {
|
||||
$valid = true;
|
||||
} else {
|
||||
$valid = false;
|
||||
$reason = $forPage->get("_isValidPage");
|
||||
if($throwException) throw new WireException("Page $value is not valid for $field->name ($reason)");
|
||||
$n = 0;
|
||||
while(wireInstanceOf($forPage, 'RepeaterPage') && ++$n < 10) {
|
||||
/** @var RepeaterPage $forPage */
|
||||
$forPage = $forPage->getForPage();
|
||||
}
|
||||
if($n && InputfieldPage::isValidPage($value, $field, $forPage)) {
|
||||
$valid = true;
|
||||
} else {
|
||||
$valid = false;
|
||||
$reason = $forPage->get("_isValidPage");
|
||||
if($throwException) throw new WireException("Page $value is not valid for $field->name ($reason)");
|
||||
}
|
||||
}
|
||||
|
||||
return $valid;
|
||||
|
@@ -86,7 +86,7 @@ class SessionHandlerDB extends WireSessionHandler implements Module, Configurabl
|
||||
* Write the given $data for the given session ID
|
||||
*
|
||||
* @param string $id Session ID
|
||||
* @param string Serialized data to write
|
||||
* @param string $data Serialized data to write
|
||||
* @return bool
|
||||
*
|
||||
*/
|
||||
@@ -203,6 +203,9 @@ class SessionHandlerDB extends WireSessionHandler implements Module, Configurabl
|
||||
|
||||
/**
|
||||
* Session configuration options
|
||||
*
|
||||
* @param array $data
|
||||
* @return InputfieldWrapper
|
||||
*
|
||||
*/
|
||||
public function getModuleConfigInputfields(array $data) {
|
||||
@@ -254,6 +257,7 @@ class SessionHandlerDB extends WireSessionHandler implements Module, Configurabl
|
||||
*
|
||||
* @param string $key
|
||||
* @param mixed $value
|
||||
* @return void
|
||||
*
|
||||
*/
|
||||
public function __set($key, $value) {
|
||||
@@ -365,7 +369,6 @@ class SessionHandlerDB extends WireSessionHandler implements Module, Configurabl
|
||||
$database = $this->wire('database');
|
||||
$sql = "ALTER TABLE $table MODIFY data MEDIUMTEXT NOT NULL";
|
||||
$query = $database->prepare($sql);
|
||||
$success = false;
|
||||
$query->execute();
|
||||
$this->message("Updated sessions database for larger data storage", Notice::log);
|
||||
}
|
||||
|
Reference in New Issue
Block a user