Page Menu
Home
In-Portal Phabricator
Search
Configure Global Search
Log In
Files
F1098736
D386.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
Thu, Aug 14, 4:54 AM
Size
929 B
Mime Type
text/x-diff
Expires
Fri, Aug 15, 4:54 AM (1 h, 25 m)
Engine
blob
Format
Raw Data
Handle
709851
Attached To
D386: INP-1788 - Trigger a warning, when not all fields were updated via "kDBItem::Update" method call
D386.diff
View Options
Index: branches/5.2.x/core/kernel/db/dbitem.php
===================================================================
--- branches/5.2.x/core/kernel/db/dbitem.php
+++ branches/5.2.x/core/kernel/db/dbitem.php
@@ -736,7 +736,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