mirror of
https://github.com/processwire/processwire.git
synced 2025-08-17 04:04:13 +02:00
Various minor adjustments
This commit is contained in:
@@ -497,7 +497,7 @@ class Pagefile extends WireData {
|
|||||||
break;
|
break;
|
||||||
case 'URL':
|
case 'URL':
|
||||||
// nocache url
|
// nocache url
|
||||||
$value = $this->url() . '?nc=' . @filemtime($this->filename());
|
$value = $this->noCacheURL();
|
||||||
break;
|
break;
|
||||||
case 'pagefiles':
|
case 'pagefiles':
|
||||||
$value = $this->pagefiles;
|
$value = $this->pagefiles;
|
||||||
@@ -528,6 +528,18 @@ class Pagefile extends WireData {
|
|||||||
return $value;
|
return $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Hookable no-cache URL
|
||||||
|
*
|
||||||
|
* #pw-internal
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
protected function ___noCacheURL() {
|
||||||
|
return $this->url() . '?nc=' . @filemtime($this->filename());
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the next sibling Pagefile in the parent Pagefiles, or NULL if at the end.
|
* Return the next sibling Pagefile in the parent Pagefiles, or NULL if at the end.
|
||||||
*
|
*
|
||||||
|
@@ -90,6 +90,7 @@ class FieldtypeImage extends FieldtypeFile {
|
|||||||
}
|
}
|
||||||
$variations = array();
|
$variations = array();
|
||||||
foreach($img->getVariations() as $variation) {
|
foreach($img->getVariations() as $variation) {
|
||||||
|
/** @var Pageimage $variation */
|
||||||
$variations[$variation->name] = $variation->httpUrl();
|
$variations[$variation->name] = $variation->httpUrl();
|
||||||
}
|
}
|
||||||
$value[$k]['variations'] = $variations;
|
$value[$k]['variations'] = $variations;
|
||||||
|
@@ -599,9 +599,18 @@ class FieldtypePage extends FieldtypeMulti implements Module, ConfigurableModule
|
|||||||
if(InputfieldPage::isValidPage($value, $field, $forPage)) {
|
if(InputfieldPage::isValidPage($value, $field, $forPage)) {
|
||||||
$valid = true;
|
$valid = true;
|
||||||
} else {
|
} else {
|
||||||
$valid = false;
|
$n = 0;
|
||||||
$reason = $forPage->get("_isValidPage");
|
while(wireInstanceOf($forPage, 'RepeaterPage') && ++$n < 10) {
|
||||||
if($throwException) throw new WireException("Page $value is not valid for $field->name ($reason)");
|
/** @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;
|
return $valid;
|
||||||
|
@@ -86,7 +86,7 @@ class SessionHandlerDB extends WireSessionHandler implements Module, Configurabl
|
|||||||
* Write the given $data for the given session ID
|
* Write the given $data for the given session ID
|
||||||
*
|
*
|
||||||
* @param string $id Session ID
|
* @param string $id Session ID
|
||||||
* @param string Serialized data to write
|
* @param string $data Serialized data to write
|
||||||
* @return bool
|
* @return bool
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@@ -203,6 +203,9 @@ class SessionHandlerDB extends WireSessionHandler implements Module, Configurabl
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Session configuration options
|
* Session configuration options
|
||||||
|
*
|
||||||
|
* @param array $data
|
||||||
|
* @return InputfieldWrapper
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public function getModuleConfigInputfields(array $data) {
|
public function getModuleConfigInputfields(array $data) {
|
||||||
@@ -254,6 +257,7 @@ class SessionHandlerDB extends WireSessionHandler implements Module, Configurabl
|
|||||||
*
|
*
|
||||||
* @param string $key
|
* @param string $key
|
||||||
* @param mixed $value
|
* @param mixed $value
|
||||||
|
* @return void
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public function __set($key, $value) {
|
public function __set($key, $value) {
|
||||||
@@ -365,7 +369,6 @@ class SessionHandlerDB extends WireSessionHandler implements Module, Configurabl
|
|||||||
$database = $this->wire('database');
|
$database = $this->wire('database');
|
||||||
$sql = "ALTER TABLE $table MODIFY data MEDIUMTEXT NOT NULL";
|
$sql = "ALTER TABLE $table MODIFY data MEDIUMTEXT NOT NULL";
|
||||||
$query = $database->prepare($sql);
|
$query = $database->prepare($sql);
|
||||||
$success = false;
|
|
||||||
$query->execute();
|
$query->execute();
|
||||||
$this->message("Updated sessions database for larger data storage", Notice::log);
|
$this->message("Updated sessions database for larger data storage", Notice::log);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user