From 5ad6986820edbe03c37556e1c78cf674d03fe474 Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Sat, 3 Feb 2018 00:30:01 -0600 Subject: [PATCH] Update: provide a temporary/quick-fix solution for displaying an array of error details --- .../base/classes/base_error_messages_english.php | 24 ++++++++++++++++++++-- .../base/classes/base_error_messages_japanese.php | 24 ++++++++++++++++++++-- 2 files changed, 44 insertions(+), 4 deletions(-) diff --git a/common/base/classes/base_error_messages_english.php b/common/base/classes/base_error_messages_english.php index 2a18123..5288c28 100644 --- a/common/base/classes/base_error_messages_english.php +++ b/common/base/classes/base_error_messages_english.php @@ -75,7 +75,17 @@ final class c_base_error_messages_english implements i_base_error_messages { if (isset($details['arguments']) && is_array($details['arguments'])) { if ($html) { foreach ($details['arguments'] as $detail_name => $detail_value) { - if (!is_string($detail_value)) { + if (is_array($detail_value)) { + // @fixme: re-write as necessary to handle multiple values. + $detail_value = reset($detail_value); + if (isset($detail_value['message']) && is_string($detail_value['message'])) { + $detail_value = $detail_value['message']; + } + else { + $detail_value = ''; + } + } + else if (!is_string($detail_value)) { $detail_value = ''; } @@ -90,7 +100,17 @@ final class c_base_error_messages_english implements i_base_error_messages { } else { foreach ($details['arguments'] as $detail_name => $detail_value) { - if (!is_string($detail_value)) { + if (is_array($detail_value)) { + // @fixme: re-write as necessary to handle multiple values. + $detail_value = reset($detail_value); + if (isset($detail_value['message']) && is_string($detail_value['message'])) { + $detail_value = $detail_value['message']; + } + else { + $detail_value = ''; + } + } + else if (!is_string($detail_value)) { $detail_value = ''; } diff --git a/common/base/classes/base_error_messages_japanese.php b/common/base/classes/base_error_messages_japanese.php index afeff59..fe96b6c 100644 --- a/common/base/classes/base_error_messages_japanese.php +++ b/common/base/classes/base_error_messages_japanese.php @@ -80,7 +80,17 @@ final class c_base_error_messages_japanese implements i_base_error_messages { if (isset($details['arguments']) && is_array($details['arguments'])) { if ($html) { foreach ($details['arguments'] as $detail_name => $detail_value) { - if (!is_string($detail_value)) { + if (is_array($detail_value)) { + // @fixme: re-write as necessary to handle multiple values. + $detail_value = reset($detail_value); + if (isset($detail_value['message']) && is_string($detail_value['message'])) { + $detail_value = $detail_value['message']; + } + else { + $detail_value = ''; + } + } + else if (!is_string($detail_value)) { $detail_value = ''; } @@ -95,7 +105,17 @@ final class c_base_error_messages_japanese implements i_base_error_messages { } else { foreach ($details['arguments'] as $detail_name => $detail_value) { - if (!is_string($detail_value)) { + if (is_array($detail_value)) { + // @fixme: re-write as necessary to handle multiple values. + $detail_value = reset($detail_value); + if (isset($detail_value['message']) && is_string($detail_value['message'])) { + $detail_value = $detail_value['message']; + } + else { + $detail_value = ''; + } + } + else if (!is_string($detail_value)) { $detail_value = ''; } -- 1.8.3.1