Skip to content

Placeholder for a deleted record; throw instead of E_USER_ERROR (#5, #6) - #17

Merged
micschk merged 6 commits into
mainfrom
fix/issues-5-6
Nov 3, 2026
Merged

micschk merged 6 commits into
mainfrom
fix/issues-5-6

Conversation

@micschk

@micschk micschk commented Nov 3, 2026

Copy link
Copy Markdown
Member

Release 5.2.2.

Tests first, one commit per issue (a2ccc12, d4b235c). CI on the tests-only head d4b235c (run 41668994116) was red on exactly those two tests on all four legs (SS5 PHP 8.1/8.3, SS6 PHP 8.3/8.4); the other 40 passed. Locally on a Silverstripe 5 host (PHP 8.3): 2 errors before the fixes, 42/42 after.

Closes #5
Closes #6

Pair-programmed with my buddy Claude

…on (#6)

Fails on the current code: byID() returns null for an ObjectID that no longer exists and
shortcodePlaceHolder() calls hasMethod() on it ("Call to a member function hasMethod() on null").

Pair-programmed with my buddy Claude
…#5)

Fails on the current code, which raises user_error(..., E_USER_ERROR); PHP 8.4 deprecates
passing E_USER_ERROR to trigger_error().

Pair-programmed with my buddy Claude
#6)

shortcodePlaceHolder() took the byID() result as is, so an ObjectID whose record no longer
exists ended in a 500 (hasMethod() on null). The class singleton now answers, as it already
did for a request without an ObjectID.

Pair-programmed with my buddy Claude
)

PHP 8.4 deprecates passing E_USER_ERROR to trigger_error(). The message is unchanged. Behaviour
change for a misconfigured site: a catchable LogicException instead of a fatal error.

Pair-programmed with my buddy Claude
Pair-programmed with my buddy Claude
@micschk
micschk merged commit 47c0131 into main Nov 3, 2026
9 checks passed
@micschk
micschk deleted the fix/issues-5-6 branch November 3, 2026 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enhancement: handle a missing ObjectID in the placeholder Enhancement: throw instead of E_USER_ERROR in register_class()

1 participant