From: Kevin Day Date: Sat, 3 Feb 2018 06:30:01 +0000 (-0600) Subject: Update: provide a temporary/quick-fix solution for displaying an array of error details X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=5ad6986820edbe03c37556e1c78cf674d03fe474;p=koopa Update: provide a temporary/quick-fix solution for displaying an array of error details --- 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 = ''; }