summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLester Caine <lester@lsces.co.uk>2026-05-31 13:22:45 +0100
committerLester Caine <lester@lsces.co.uk>2026-05-31 13:22:45 +0100
commit73ab0d88e8235556d55b9deb453ae7b74b763436 (patch)
treecc2d1abb3a145e2366a67e96ddd30fcc535be9d3
parent28267bab3562a81b591000f537c3ef1f3420ebe0 (diff)
downloadcontact-73ab0d88e8235556d55b9deb453ae7b74b763436.tar.gz
contact-73ab0d88e8235556d55b9deb453ae7b74b763436.tar.bz2
contact-73ab0d88e8235556d55b9deb453ae7b74b763436.zip
Fix contact type checkboxes storing wrong value; fix null trim
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 <noreply@anthropic.com>
-rwxr-xr-xincludes/classes/Contact.php2
-rwxr-xr-xtemplates/edit_type_header.tpl6
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 @@
<div class="form-group">
- {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}
- <input type="checkbox" name="contact_types[{$type_id}]" value={$type.source} {if isset($type.content_id) } checked="checked"{/if} /> {$type.cross_ref_title}<br/>
+ <input type="checkbox" name="contact_types[{$type_id}]" value="{$type.item}" {if isset($type.content_id) } checked="checked"{/if} /> {$type.cross_ref_title}<br/>
{/foreach}
{else}
{foreach from=$gContent->mInfo.contact_type_list key=type_id item=type}
- <input type="checkbox" name="contact_types[$type_id]" value={$type.source} />{$type.name}<br/>
+ <input type="checkbox" name="contact_types[$type_id]" value="{$type.item}" />{$type.name}<br/>
{/foreach}
{/if}
{/forminput}