mirror of
https://github.com/processwire/processwire.git
synced 2025-08-09 08:17:12 +02:00
Various minor updates
This commit is contained in:
@@ -381,7 +381,7 @@ class Session extends Wire implements \IteratorAggregate {
|
||||
// if valid, update last request time
|
||||
$this->set('_user', 'ts', time());
|
||||
|
||||
} else if($reason && $userID && $userID != $this->wire('config')->guestUserPageID) {
|
||||
} else if($reason && $userID && $userID != $this->config->guestUserPageID) {
|
||||
// otherwise log the invalid session
|
||||
$user = $this->wire()->users->get((int) $userID);
|
||||
if($user && $user->id) $reason = "User '$user->name' - $reason";
|
||||
|
@@ -6,7 +6,7 @@ if(!defined("PROCESSWIRE")) die();
|
||||
* This file is just here for backwards compatibility
|
||||
*
|
||||
* It is called by /site/templates/admin.php on sites running a /site/templates/ dir from before the admin
|
||||
* controller was move to the /wire/core/admin.php dir.
|
||||
* controller was moved to the /wire/core/admin.php dir.
|
||||
*
|
||||
* This file need not be present in new admin themes, and will eventually be removed from this theme.
|
||||
*
|
||||
|
@@ -1369,6 +1369,7 @@ class FieldtypeRepeater extends Fieldtype implements ConfigurableModule, Fieldty
|
||||
|
||||
// remove unpublished and ready items that shouldn't be here
|
||||
foreach($value as $p) {
|
||||
$p->of(true); // ensure RepeaterPage items also formatted
|
||||
$cnt++;
|
||||
if($p->isHidden() || $p->isUnpublished() || ($maxItems && $cnt > $maxItems)) {
|
||||
if(is_null($formatted)) $formatted = clone $value;
|
||||
@@ -1381,6 +1382,10 @@ class FieldtypeRepeater extends Fieldtype implements ConfigurableModule, Fieldty
|
||||
}
|
||||
}
|
||||
|
||||
if($formatted) {
|
||||
foreach($formatted as $p) $p->of(true);
|
||||
}
|
||||
|
||||
return is_null($formatted) ? $value : $formatted;
|
||||
}
|
||||
|
||||
|
@@ -78,10 +78,10 @@ class RepeaterPage extends Page {
|
||||
if(strpos($parentName, $prefix) === 0) {
|
||||
// determine owner page from parent name in format: for-page-1234
|
||||
$forID = (int) substr($parentName, strlen($prefix));
|
||||
$this->forPage = $this->wire('pages')->get($forID);
|
||||
$this->forPage = $this->wire()->pages->get($forID);
|
||||
} else {
|
||||
// this probably can't occur, but here just in case
|
||||
$this->forPage = $this->wire('pages')->newNullPage();
|
||||
$this->forPage = $this->wire()->pages->newNullPage();
|
||||
}
|
||||
|
||||
return $this->forPage;
|
||||
@@ -284,4 +284,3 @@ class RepeaterPage extends Page {
|
||||
return $p->id ? $p->getAccessTemplate($type) : parent::getAccessTemplate($type);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user