Repository navigation
Placeholder for a deleted record; throw instead of E_USER_ERROR (#5, #6) [4.x] - #18
Merged
Merged
Conversation
#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
Pair-programmed with my buddy Claude
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.
Release 4.0.19. Backport of the two PHP fixes in #17 (cherry-picked, unchanged).
shortcodePlaceHolder()falls back to the class singleton when theObjectIDrecord no longer exists (Enhancement: handle a missing ObjectID in the placeholder #6).Shortcodable::register_class()throws aLogicExceptioninstead ofuser_error(..., E_USER_ERROR)(Enhancement: throw instead of E_USER_ERROR in register_class() #5). Same behaviour change as 5.2.2. The 4.x README does not mentionE_USER_ERROR, so it is unchanged.The 4.x branch has no tests or CI of its own. main's PHPUnit suite (from #17, incl. the two new tests) was run locally against this branch's code on a Silverstripe 5 host (PHP 8.3): on b6f7e51 the two new tests fail (
hasMethod() on null; the E_USER_ERROR); after the fixes both pass. The same 8 other tests fail before and after: they cover 5.x-only behaviour (is_tinymce_config(), editor.css, the 5.2.0shortcode_close_parentrework). Not tested: Silverstripe 4.Refs #5, #6 (closed by #17)
Pair-programmed with my buddy Claude