Page Menu
Home
In-Portal Phabricator
Search
Configure Global Search
Log In
Files
F726923
D386.id936.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
Mon, Jan 6, 3:22 AM
Size
884 B
Mime Type
text/x-diff
Expires
Tue, Jan 7, 3:22 AM (2 d, 19 h ago)
Engine
blob
Format
Raw Data
Handle
537007
Attached To
D386: INP-1788 - Trigger a warning, when not all fields were updated via "kDBItem::Update" method call
D386.id936.diff
View Options
Index: core/kernel/db/dbitem.php
===================================================================
--- core/kernel/db/dbitem.php
+++ core/kernel/db/dbitem.php
@@ -732,7 +732,25 @@
$sql = '';
- $set_fields = isset($update_fields) ? $update_fields : array_keys($this->FieldValues);
+ if ( isset($update_fields) ) {
+ $set_fields = $update_fields;
+ $forgotten_fields = array_diff(array_keys($this->GetChangedFields()), $set_fields);
+
+ if ( $forgotten_fields ) {
+ trigger_error(
+ sprintf(
+ 'These fields weren\'t updated for #%s record in "%s" unit: %s',
+ $this->GetID(),
+ $this->getPrefixSpecial(),
+ implode(', ', $forgotten_fields)
+ ),
+ E_USER_WARNING
+ );
+ }
+ }
+ else {
+ $set_fields = array_keys($this->FieldValues);
+ }
foreach ($set_fields as $field_name) {
if ( $this->skipField($field_name) ) {
Event Timeline
Log In to Comment