1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-09 00:06:55 +02:00

Various minor updates

This commit is contained in:
Ryan Cramer
2024-03-28 09:01:54 -04:00
parent 0852242866
commit 21949387b4
4 changed files with 9 additions and 5 deletions

View File

@@ -381,7 +381,7 @@ class Session extends Wire implements \IteratorAggregate {
// if valid, update last request time // if valid, update last request time
$this->set('_user', 'ts', 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 // otherwise log the invalid session
$user = $this->wire()->users->get((int) $userID); $user = $this->wire()->users->get((int) $userID);
if($user && $user->id) $reason = "User '$user->name' - $reason"; if($user && $user->id) $reason = "User '$user->name' - $reason";

View File

@@ -6,7 +6,7 @@ if(!defined("PROCESSWIRE")) die();
* This file is just here for backwards compatibility * 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 * 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. * This file need not be present in new admin themes, and will eventually be removed from this theme.
* *

View File

@@ -1369,6 +1369,7 @@ class FieldtypeRepeater extends Fieldtype implements ConfigurableModule, Fieldty
// remove unpublished and ready items that shouldn't be here // remove unpublished and ready items that shouldn't be here
foreach($value as $p) { foreach($value as $p) {
$p->of(true); // ensure RepeaterPage items also formatted
$cnt++; $cnt++;
if($p->isHidden() || $p->isUnpublished() || ($maxItems && $cnt > $maxItems)) { if($p->isHidden() || $p->isUnpublished() || ($maxItems && $cnt > $maxItems)) {
if(is_null($formatted)) $formatted = clone $value; if(is_null($formatted)) $formatted = clone $value;
@@ -1380,6 +1381,10 @@ class FieldtypeRepeater extends Fieldtype implements ConfigurableModule, Fieldty
$cnt--; $cnt--;
} }
} }
if($formatted) {
foreach($formatted as $p) $p->of(true);
}
return is_null($formatted) ? $value : $formatted; return is_null($formatted) ? $value : $formatted;
} }

View File

@@ -78,10 +78,10 @@ class RepeaterPage extends Page {
if(strpos($parentName, $prefix) === 0) { if(strpos($parentName, $prefix) === 0) {
// determine owner page from parent name in format: for-page-1234 // determine owner page from parent name in format: for-page-1234
$forID = (int) substr($parentName, strlen($prefix)); $forID = (int) substr($parentName, strlen($prefix));
$this->forPage = $this->wire('pages')->get($forID); $this->forPage = $this->wire()->pages->get($forID);
} else { } else {
// this probably can't occur, but here just in case // 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; return $this->forPage;
@@ -284,4 +284,3 @@ class RepeaterPage extends Page {
return $p->id ? $p->getAccessTemplate($type) : parent::getAccessTemplate($type); return $p->id ? $p->getAccessTemplate($type) : parent::getAccessTemplate($type);
} }
} }