Changes by CLaude
Build and Deploy / build (push) Failing after 44s

This commit is contained in:
root committed 2026-08-18 09:31:05 -01:00
1 parent 9bee381f6c
commit 30893eb7a7
21 files changed
+276 -85

No files matched your search

+16
View File
@@ -14,7 +14,23 @@ class Blog extends Model {
public $url;
public function __construct($data, $images = null, $podcast = null) {
// Convert arrays to objects for consistent handling
if(is_array($data)) {
$data = (object) $data;
}
parent::__construct($data);
// Ensure id is a string, not an array
if(is_array($this->id)) {
$this->id = $this->id[0] ?? '';
}
// Ensure title is a string, not an array
if(is_array($this->title)) {
$this->title = $this->title[0] ?? '';
}
parent::ConvertToDateTime($this->start_date);
parent::ConvertToDateTime($this->end_date);
+18 -2
View File
@@ -18,7 +18,23 @@ class CalendarEvent extends Model {
public $tags;
public function __construct($data, $images = null, $podcast = null) {
// Convert arrays to objects for consistent handling
if(is_array($data)) {
$data = (object) $data;
}
parent::__construct($data);
// Ensure id is a string, not an array
if(is_array($this->id)) {
$this->id = $this->id[0] ?? '';
}
// Ensure title is a string, not an array
if(is_array($this->title)) {
$this->title = $this->title[0] ?? '';
}
parent::ConvertToDateTime($this->starts);
parent::ConvertToDateTime($this->ends);
@@ -26,7 +42,7 @@ class CalendarEvent extends Model {
if(isset($data->keywords)) {
if(is_array($data->keywords)) {
$this->keywords = $data->keywords;
} else if(trim($data->keywords)) {
} else if(trim((string) $data->keywords)) {
$this->keywords = explode(' ', $data->keywords);
}
}
@@ -47,7 +63,7 @@ class CalendarEvent extends Model {
}
}
$this->url = "/agenda/{$this->id}/" . parent::url_slug($this->title);
$this->url = "/agenda/{$this->id}/" . parent::url_slug($this->title ?? '');
$this->metadata = (new MetaData())
->set('title', $this->title)
->set('description', strip_tags($this->excerpt()))
+17 -1
View File
@@ -12,7 +12,23 @@ class JobOpening extends Model {
public $url;
public function __construct($data, $images = null, $podcast = null) {
// Convert arrays to objects for consistent handling
if(is_array($data)) {
$data = (object) $data;
}
parent::__construct($data);
// Ensure id is a string, not an array
if(is_array($this->id)) {
$this->id = $this->id[0] ?? '';
}
// Ensure title is a string, not an array
if(is_array($this->title)) {
$this->title = $this->title[0] ?? '';
}
parent::ConvertToDateTime($this->starts);
parent::ConvertToDateTime($this->ends);
@@ -20,7 +36,7 @@ class JobOpening extends Model {
if(isset($data->keywords)) {
if(is_array($data->keywords)) {
$this->keywords = $data->keywords;
} else if(trim($data->keywords)) {
} else if(trim((string) $data->keywords)) {
$this->keywords = explode(' ', $data->keywords);
}
}
+11
View File
@@ -7,7 +7,18 @@ class KerkdienstInstance extends Model {
public $start;
public function __construct($data) {
// Convert arrays to objects for consistent handling
if(is_array($data)) {
$data = (object) $data;
}
parent::__construct($data);
// Ensure name is a string, not an array
if(is_array($this->name)) {
$this->name = $this->name[0] ?? '';
}
parent::ConvertToDateTime($this->start);
}
}
+10
View File
@@ -9,8 +9,18 @@ class NewsImage extends Model {
public $url;
public function __construct($data, $urlPrefix = '/') {
// Convert arrays to objects for consistent handling
if(is_array($data)) {
$data = (object) $data;
}
parent::__construct($data);
// Ensure title is a string, not an array
if(is_array($this->title)) {
$this->title = $this->title[0] ?? '';
}
// Deserialisatie van JSON heeft url in data,
// lezen uit database heeft file en (als het goed is) urlPrefix
if(isset($data->file)) {
+45 -11
View File
@@ -29,7 +29,23 @@ class NewsItem extends Model {
public $metadata;
public function __construct($data, $images = null, $podcast = null) {
// Convert arrays to objects for consistent handling
if(is_array($data)) {
$data = (object) $data;
}
parent::__construct($data);
// Ensure id is a string, not an array
if(is_array($this->id)) {
$this->id = $this->id[0] ?? '';
}
// Ensure title is a string, not an array
if(is_array($this->title)) {
$this->title = $this->title[0] ?? '';
}
parent::ConvertToDateTime($this->published);
parent::ConvertToDateTime($this->edited);
@@ -43,9 +59,9 @@ class NewsItem extends Model {
{
if(is_object($data->source))
{
$this->source = new \Model\NewsSource($data->source->title, $data->source->url, $data->source->show);
$this->source = new \Model\NewsSource($data->source->title ?? null, $data->source->url ?? null, $data->source->show ?? false);
} else if($data->source) {
$this->source = new \Model\NewsSource($data->source, $data->source_url, $data->showsource);
$this->source = new \Model\NewsSource($data->source, $data->source_url ?? null, $data->showsource ?? false);
}
}
@@ -59,33 +75,45 @@ class NewsItem extends Model {
if(isset($data->keywords)) {
if(is_array($data->keywords) || is_object($data->keywords)) {
$this->keywords = $data->keywords;
} else if(trim($data->keywords)) {
} else if(trim((string) $data->keywords)) {
$this->keywords = explode(' ', $data->keywords);
}
}
if(isset($data->region)) {
if(is_object($data->region)) {
$this->region = new \Model\NewsRegion($data->region->title, $data->region->slug);
$this->region = new \Model\NewsRegion($data->region->title ?? null, $data->region->slug ?? null);
} else {
$this->region = new \Model\NewsRegion($data->region, $data->region_slug);
$this->region = new \Model\NewsRegion($data->region, $data->region_slug ?? null);
}
}
if(isset($data->theme)) {
if(is_object($data->theme)) {
$this->theme = new \Model\NewsRegion($data->theme->title, $data->theme->slug);
$this->theme = new \Model\NewsRegion($data->theme->title ?? null, $data->theme->slug ?? null);
} else {
$this->theme = new \Model\NewsRegion($data->theme, $data->theme_slug);
$this->theme = new \Model\NewsRegion($data->theme, $data->theme_slug ?? null);
}
}
if(isset($data->tags)) {
$this->tags = [];
foreach($data->tags as $tag) {
$this->theme = new \Model\NewsRegion($tag->titel, $tag->slug);
if(is_object($tag)) {
$this->tags[] = new \Model\NewsRegion($tag->titel ?? null, $tag->slug ?? null);
} elseif(is_array($tag)) {
$this->tags[] = new \Model\NewsRegion($tag['titel'] ?? null, $tag['slug'] ?? null);
}
}
}
// Ensure content is iterable for views - convert string to empty array
if(isset($this->content) && is_string($this->content)) {
$this->content = [];
} elseif(!isset($this->content)) {
$this->content = [];
}
$images = ($images != null) ? $images
: (isset($data->images) ? $data->images : null);
if($images) {
@@ -95,7 +123,7 @@ class NewsItem extends Model {
}
}
$this->url = "/nieuws/{$this->id}/" . parent::url_slug($this->title);
$this->url = "/nieuws/{$this->id}/" . parent::url_slug($this->title ?? '');
$this->metadata = (new MetaData())
->set('title', $this->title)
->set('description', strip_tags($this->excerpt()))
@@ -108,11 +136,17 @@ class NewsItem extends Model {
}
public function excerpt() {
// Handle case where content might be an array of blocks instead of a string
if(is_array($this->content) || is_object($this->content)) {
return '<p class="news-excerpt"></p>';
}
$hasImages = isset($this->images) && count($this->images) > 0;
$maxLength = $hasImages ? 200 : 500;
$text = (string) $this->content;
return '<p class="news-excerpt ' . ($hasImages ? 'short' : 'long') . '">' .
substr($this->content, 0, $maxLength) .
(strlen($this->content) > $maxLength ? '...' : '') .
substr($text, 0, $maxLength) .
(strlen($text) > $maxLength ? '...' : '') .
'</p>';
}
}
+4 -2
View File
@@ -4,11 +4,13 @@ namespace Model;
class NewsRegion {
public $title;
public $titel; // Support both English and Dutch spelling
public $slug;
public function __construct($title, $slug = null) {
public function __construct($title = null, $slug = null) {
$this->title = $title;
$this->slug = $slug ? $slug : strtolower(str_replace(' ', '', $title));
$this->titel = $title; // Also set titel for compatibility with API responses
$this->slug = $slug ? $slug : ($title ? strtolower(str_replace(' ', '', $title)) : null);
}
}
+32 -3
View File
@@ -21,10 +21,31 @@ class Podcast extends Model {
private $key;
public function __construct($data) {
// Convert arrays to objects for consistent handling
if(is_array($data)) {
$data = (object) $data;
}
parent::__construct($data);
// Ensure id is a string, not an array
if(is_array($this->id)) {
$this->id = $this->id[0] ?? '';
}
// Ensure title is a string, not an array
if(is_array($this->title)) {
$this->title = $this->title[0] ?? '';
}
// Ensure image is not an array from API
if(is_array($this->image)) {
$this->image = null;
}
parent::ConvertToDateTime($this->created);
$this->url = '/' . $this->id . '/' . parent::url_slug($this->title) . '.mp3';
$this->url = '/' . $this->id . '/' . parent::url_slug($this->title ?? '') . '.mp3';
if($this->soundfilename) {
// Only generate when not constructing from a JSON object
$this->key = sha1($this->id . ':' . date('Y-m-d') . ':' . $this->soundfilename);
@@ -36,7 +57,15 @@ class Podcast extends Model {
if(is_object($data->program)) {
$this->program = new \Model\Program($data->program);
} elseif($data->program) {
$this->program = new \Model\Program(['id' => $data->program, 'name' => $data->program_name, 'description' => $data->program_description]);
$program_name = $data->program_name ?? null;
if(is_array($program_name)) {
$program_name = $program_name[0] ?? null;
}
$program_desc = $data->program_description ?? null;
if(is_array($program_desc)) {
$program_desc = $program_desc[0] ?? null;
}
$this->program = new \Model\Program((object) ['id' => $data->program, 'name' => $program_name, 'description' => $program_desc]);
}
}
@@ -44,7 +73,7 @@ class Podcast extends Model {
$imagedata = new \stdClass();
$imagedata->id = $this->id;
$imagedata->file = $data->imagefile;
$imagedata->title = $data->imagecaption;
$imagedata->title = $data->imagecaption ?? null;
$this->image = new NewsImage($imagedata, '/img/podcast/');
}
+22 -3
View File
@@ -18,10 +18,29 @@ class Program extends Model {
public $next;
public function __construct($data) {
// Convert arrays to objects for consistent handling
if(is_array($data)) {
$data = (object) $data;
}
parent::__construct($data);
// Ensure id is a string, not an array
if(is_array($this->id)) {
$this->id = $this->id[0] ?? '';
}
// Ensure name is a string, not an array
if(is_array($this->name)) {
$this->name = $this->name[0] ?? '';
}
if(isset($data->suffix) && $data->suffix) {
$this->name .= ' ' . $data->suffix;
$suffix = $data->suffix;
if(is_array($suffix)) {
$suffix = $suffix[0] ?? '';
}
$this->name .= ' ' . $suffix;
}
if($this->recent && $this->recent) {
@@ -37,7 +56,7 @@ class Program extends Model {
}
}
if(isset($data->email) && ($mailComma = strpos($data->email, ',')) !== false) {
if(isset($data->email) && ($mailComma = strpos((string) $data->email, ',')) !== false) {
$this->email = substr($data->email, 0, $mailComma);
}
@@ -46,7 +65,7 @@ class Program extends Model {
$this->rerun = $data->state == 3;
}
$this->url = "/{$this->id}/" . parent::url_slug($this->name);
$this->url = "/{$this->id}/" . parent::url_slug($this->name ?? '');
}
public function isSpecial() {
+14
View File
@@ -6,5 +6,19 @@ class ProgramHost extends Model {
public $id;
public $name;
public $email;
public function __construct($data) {
// Convert arrays to objects for consistent handling
if(is_array($data)) {
$data = (object) $data;
}
parent::__construct($data);
// Ensure name is a string, not an array
if(is_array($this->name)) {
$this->name = $this->name[0] ?? '';
}
}
}
+17
View File
@@ -12,7 +12,24 @@ class Track extends Model {
public $isLayout;
public function __construct($data) {
// Convert arrays to objects for consistent handling
if(is_array($data)) {
$data = (object) $data;
}
parent::__construct($data);
// Ensure string fields are not arrays
if(is_array($this->title)) {
$this->title = $this->title[0] ?? '';
}
if(is_array($this->itemCode)) {
$this->itemCode = $this->itemCode[0] ?? '';
}
if(is_array($this->artist)) {
$this->artist = $this->artist[0] ?? '';
}
parent::ConvertToDateTime($this->start);
parent::ConvertToDateTime($this->ends);
$isLayout = $this->isLayout();