]> Kevux Git Server - koopa/commitdiff
Update: provide a temporary/quick-fix solution for displaying an array of error details
authorKevin Day <thekevinday@gmail.com>
Sat, 3 Feb 2018 06:30:01 +0000 (00:30 -0600)
committerKevin Day <thekevinday@gmail.com>
Sat, 3 Feb 2018 06:31:15 +0000 (00:31 -0600)
common/base/classes/base_error_messages_english.php
common/base/classes/base_error_messages_japanese.php

index 2a18123d0c90e498329f34bb625a30c1958e97df..5288c28b4889712415dac63970b95b453a275a97 100644 (file)
@@ -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 = '';
           }
 
index afeff59720d0632e7282ec62622ad36094674fb5..fe96b6cbd4aae362c4ce005b3b0b04f47f5ec67e 100644 (file)
@@ -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 = '';
           }