fix: sensitive toggle on Controller fails with TypeError (metadata-only PUT)#91
Merged
Merged
Conversation
…r on metadata-only PUT
Third meta-controller sibling of the 4.5.1 DataModel/ModelAttribute
fix. Toggling sensitive=1 on a Controller returned 200 empty + "Save
failed."
ControllerController::validateControllerUpdate early-returns only when
$o->name === $r['name']. A metadata-only PUT of {sensitive:1} omits
name, so $r['name'] is null; "SomeController" === null is false, so it
fell through and passed null into the typed
checkNameExistsInScope(string $name) -> TypeError -> swallowed by the
global exception handler (logged as KyteError, hence the empty 200) ->
update aborted before sensitive persisted.
Fix: return early when name is absent —
if (!isset($r['name']) || $o->name === $r['name']). The name-change
path (always sends name) is unaffected.
Confirmed via DEBUG_SQL on ORB: PUT Controller id=46 {sensitive:1}
logged exactly this TypeError at ControllerController.php:70.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Completes the 4.5.1 fix for the third meta-controller. Toggling
sensitive=1on a Controller returned 200-empty + "Save failed."validateControllerUpdateearly-returned only on$o->name === $r['name']. A{sensitive:1}PUT omitsname→"SomeController" === nullis false → fell through →checkNameExistsInScope(string $name)gotnull→ TypeError → swallowed by the exception handler (logged as KyteError, hence empty 200) → save aborted.Fix:
if (!isset($r['name']) || $o->name === $r['name']) return;Confirmed on ORB via DEBUG_SQL:
PUT Controller id=46 {sensitive:1}logged exactly this TypeError at ControllerController.php:70.Test plan
sensitive=1, non-empty responsename)Target v4.5.2. No schema change.
🤖 Generated with Claude Code