Page Menu
Home
In-Portal Phabricator
Search
Configure Global Search
Log In
Files
F803806
D398.id1056.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Wed, Feb 26, 8:58 AM
Size
1 KB
Mime Type
text/x-diff
Expires
Thu, Feb 27, 8:58 AM (10 h, 21 m)
Engine
blob
Format
Raw Data
Handle
576530
Attached To
D398: INP-1798 - Include validation errors and temp mode flag in kDBItem validation error message
D398.id1056.diff
View Options
Index: branches/5.2.x/core/kernel/utility/validator.php
===================================================================
--- branches/5.2.x/core/kernel/utility/validator.php
+++ branches/5.2.x/core/kernel/utility/validator.php
@@ -114,12 +114,26 @@
$item_info[] = key($title_info) . ': <strong>' . current($title_info) . '</strong>';
}
- $error_msg = ' Validation failed in prefix - <strong>' . $this->dataSource->Prefix . '</strong> (' . implode('; ', $item_info) . '),
- FieldErrors follow (look at items with <strong>"pseudo"</strong> key set)<br />
- You may ignore this notice if submitted data really has a validation error';
- trigger_error(trim($error_msg), E_USER_NOTICE);
+ $item_info[] = 'Temp Mode: <strong>' . ($this->dataSource->IsTempTable() ? 'Yes' : 'No') . '</strong>';
+
+ $raw_errors = array_filter($this->FieldErrors, function ($error_params) {
+ return isset($error_params['pseudo']);
+ });
+
+ $error_msg = <<<HTML
+Validation failed for <strong>%s</strong> item (%s).<br/>
+<strong>Validation errors:</strong><br/>
+<pre>%s</pre>
+You may ignore this notice if submitted data really has a validation error.
+HTML;
+ $error_msg = sprintf(
+ $error_msg,
+ $this->dataSource->getPrefixSpecial(),
+ implode('; ', $item_info),
+ print_r($raw_errors, true)
+ );
- $this->Application->Debugger->dumpVars($this->FieldErrors);
+ trigger_error(trim($error_msg), E_USER_NOTICE);
}
return $global_res;
Event Timeline
Log In to Comment