From bb3bbaaeab49526bad0f8a2755e9ffbb4cbe76dd Mon Sep 17 00:00:00 2001 From: Felix Niklas Date: Tue, 18 Mar 2025 11:55:28 +0100 Subject: [PATCH] Replace deprecated $model->contentFile() method Makes sitemapper Kirby 4 compatible. --- index.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.php b/index.php index e0c2fa0..6b95b49 100755 --- a/index.php +++ b/index.php @@ -145,7 +145,7 @@ // We start by checking what content translations we actually have: $langs = []; foreach (kirby()->languages() as $lang){ - if(!empty(F::modified($this->contentFile($lang->code())))) { $langs[] = $lang; } + if(!empty(F::modified($this->translation($lang->code())->contentFile()))) { $langs[] = $lang; } } // add the existing language page URLs to the sitemap: foreach ($langs as $lang) { @@ -153,7 +153,7 @@ // check whether the page should be included in sitemap: if(!$this->showInSitemap($code)){ continue; } $url = $this->url($code); - $pgMap[$url]['mod'] = F::modified($this->contentFile($code),'c','date'); + $pgMap[$url]['mod'] = F::modified($this->translation($code)->contentFile(),'c','date'); $pgMap[$url]['lang'] = []; foreach ($langs as $l) { // try to get the locale set by the user -