From 73ab0d88e8235556d55b9deb453ae7b74b763436 Mon Sep 17 00:00:00 2001 From: Lester Caine Date: Sun, 31 May 2026 13:22:45 +0100 Subject: Fix contact type checkboxes storing wrong value; fix null trim MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit edit_type_header.tpl: value was {$type.source} (unquoted, wrong field) — changed to "{$type.item}" so $04 etc are submitted correctly. Label corrected from "Content Types" to "Contact Types". Contact.php: organisation trim() now handles null from DB. Co-Authored-By: Claude Sonnet 4.6 --- includes/classes/Contact.php | 2 +- templates/edit_type_header.tpl | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/includes/classes/Contact.php b/includes/classes/Contact.php index 4cea7d0..bb48666 100755 --- a/includes/classes/Contact.php +++ b/includes/classes/Contact.php @@ -105,7 +105,7 @@ class Contact extends LibertyContent { $this->mInfo['creator'] = $result->fields['creator_real_name'] ?? $result->fields['creator_user']; $this->mInfo['editor'] = $result->fields['modifier_real_name'] ?? $result->fields['modifier_user']; $this->mInfo['display_url'] = $this->getDisplayUrl(); - $this->mInfo['organisation'] = trim($this->mInfo['organisation']); + $this->mInfo['organisation'] = trim($this->mInfo['organisation'] ?? ''); $name = explode( '|', $this->mInfo['name'] ?? '' ); $this->mInfo['prefix'] = $name[0] ?? ''; $this->mInfo['forename'] = $name[1] ?? ''; diff --git a/templates/edit_type_header.tpl b/templates/edit_type_header.tpl index 171ec58..4ca117f 100755 --- a/templates/edit_type_header.tpl +++ b/templates/edit_type_header.tpl @@ -1,13 +1,13 @@
- {formlabel label="Content Types" for=content_types} + {formlabel label="Contact Types" for=content_types} {forminput} {if isset( $gContent->mInfo.contact_types ) } {foreach from=$gContent->mInfo.contact_types key=type_id item=type} - {$type.cross_ref_title}
+ {$type.cross_ref_title}
{/foreach} {else} {foreach from=$gContent->mInfo.contact_type_list key=type_id item=type} - {$type.name}
+ {$type.name}
{/foreach} {/if} {/forminput} -- cgit v1.3