commit c19b965679f598eacf2ec3820307643600337cd9
parent 4cefac2cbbdc5e397fd31631165d83df8b02d47a
Author: markseu <mark2011@mayberg.se>
Date: Fri, 17 Jan 2025 11:15:09 +0100
Updated core, improve API path ancestry
Diffstat:
3 files changed, 12 insertions(+), 10 deletions(-)
diff --git a/system/extensions/update-available.ini b/system/extensions/update-available.ini
@@ -149,14 +149,14 @@ system/themes/copenhagen.css: copenhagen.css, create, update, careful
system/themes/copenhagen.png: copenhagen.png, create
Extension: Core
-Version: 0.9.13
+Version: 0.9.14
Description: Core functionality of your website.
Developer: Anna Svensson
Tag: feature
DownloadUrl: https://github.com/annaesvensson/yellow-core/archive/refs/heads/main.zip
DocumentationUrl: https://github.com/annaesvensson/yellow-core
DocumentationLanguage: en, de, sv
-Published: 2024-11-25 14:54:03
+Published: 2025-01-17 11:06:48
Status: available
system/workers/core.php: core.php, create, update
system/extensions/core.php: corepatch.txt, update
diff --git a/system/extensions/yellow-extension.ini b/system/extensions/yellow-extension.ini
@@ -1,14 +1,14 @@
# Datenstrom Yellow extension settings
Extension: Core
-Version: 0.9.13
+Version: 0.9.14
Description: Core functionality of your website.
Developer: Anna Svensson
Tag: feature
DownloadUrl: https://github.com/annaesvensson/yellow-core/archive/refs/heads/main.zip
DocumentationUrl: https://github.com/annaesvensson/yellow-core
DocumentationLanguage: en, de, sv
-Published: 2024-11-25 14:54:03
+Published: 2025-01-17 11:06:48
Status: available
system/workers/core.php: core.php, create, update
system/extensions/core.php: corepatch.txt, update
diff --git a/system/workers/core.php b/system/workers/core.php
@@ -2,7 +2,7 @@
// Core extension, https://github.com/annaesvensson/yellow-core
class YellowCore {
- const VERSION = "0.9.13";
+ const VERSION = "0.9.14";
const RELEASE = "0.9";
public $content; // content files
public $media; // media files
@@ -395,11 +395,13 @@ class YellowContent {
public function path($location, $absoluteLocation = false) {
$pages = new YellowPageCollection($this->yellow);
if ($absoluteLocation) $location = substru($location, strlenu($this->yellow->page->base));
- if ($page = $this->find($location)) {
- $pages->prepend($page);
- for (; $parent = $page->getParent(); $page=$parent) {
- $pages->prepend($parent);
- }
+ $page = null;
+ while (!$this->yellow->lookup->isRootLocation($location)) {
+ $page = $this->find($location);
+ if ($page) $pages->prepend($page);
+ $location = $this->getParentLocation($location);
+ }
+ if ($page) {
$home = $this->find($this->getHomeLocation($page->location));
if ($home && $home->location!=$page->location) $pages->prepend($home);
}