You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Prompt user when attribute values cannot be converted during type change #4632
When editing an attribute definition and changing its type (e.g. TEXT → DECIMAL or TEXT → DATE), existing attribute_values that can't convert to the new type cause the whole save to fail with no useful feedback to the user.
Previously this also crashed with ErrorException: Array to string conversion in Attribute::check_data_validity() (fixed separately). With that crash fixed, the underlying UX gap remains: the save silently rolls back and the user only sees a generic "cannot be updated" message, with no indication of which values are the problem or any way to proceed.
Current behavior
Attribute::check_data_validity() (app/Models/Attribute.php, ~line 376) checks each existing value against the new type and logs an error for any that fail, but doesn't surface this to the caller beyond a boolean.
Attribute::convert_definition_data() (~line 438) returns false if validity check fails.
Attribute::saveDefinition() (~line 529) rolls back the entire transaction when conversion fails.
Attributes::postSaveDefinition() (app/Controllers/Attributes.php) returns a generic failure JSON response with no detail about affected values/items.
Proposed behavior
When a type-changing save hits non-convertible values, show a modal explaining that some attribute values cannot be converted to the new type, with two options:
Continue — drop/discard the non-convertible attribute values and proceed with the type change
Cancel — abort the save (current behavior)
Implementation notes
Backend: postSaveDefinition() needs to surface which values (and/or affected items) are non-convertible in its JSON response instead of a generic failure, and support a "force"/"drop invalid values" flag that, when set, proceeds with the conversion while discarding the offending values.
Frontend: the attribute definition save form (attributes/form view JS) needs a confirmation modal that triggers on this new response shape, and resubmits with the force flag on "Continue".
In app/Models/Attribute.php, check_data_validity() still only returns a boolean (no detail on which values/items failed beyond a log_message('error', ...) call), convert_definition_data() still returns false on failure with no force/override path, and saveDefinition() still does:
with no "drop invalid values and continue" flag. app/Controllers/Attributes.php's postSaveDefinition() correspondingly still has no mechanism to surface affected values/items in its JSON response or accept a force flag. There is an open, unmerged PR addressing this: #4642 "Prompt user when attribute values cannot be converted during type change" (state: open as of this check).
Activity
objecttothis commentedon Oct 22, 2026
Claude Issue Checker Agent (cc @objecttothis)
Investigated against current
master.Status: Still present (not yet merged).
In
app/Models/Attribute.php,check_data_validity()still only returns a boolean (no detail on which values/items failed beyond alog_message('error', ...)call),convert_definition_data()still returnsfalseon failure with no force/override path, andsaveDefinition()still does:with no "drop invalid values and continue" flag.
app/Controllers/Attributes.php'spostSaveDefinition()correspondingly still has no mechanism to surface affected values/items in its JSON response or accept a force flag. There is an open, unmerged PR addressing this: #4642 "Prompt user when attribute values cannot be converted during type change" (state: open as of this check).