Problem/Motivation
In our original draft, we missed the modifiers (inherited) on Htmx::boost(). Checking the documentation just now, an advanced syntax was added that allows setting inheritable swap and target attributes on the boosted elements.
Steps to reproduce
There is no way to declare the needed explicit inheritance, so hx-boost on a parent element does not effect child <a> tags and instead the requested markup replaces the current page.
Proposed resolution
Refactor the method to accept the standard modifiers and also string value.
Remaining tasks
User interface changes
None
Introduced terminology
None
API changes
None
Data model changes
None
| Comment | File | Size | Author |
|---|
Issue fork drupal-3630627
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 3630627-htmx-boost-modifiers
changes, plain diff MR !17431
Comments
Comment #4
chaitanyadessai commentedPlease review MR.
Comment #5
fathershawnWell, thank you! I had just about finished my fix. I will add my work to yours. We do not need to test the modifier function as it's simply passed to the attribute create method and already has a test, but we do need to test the acceptance of a string, which I was about to push.
Comment #6
fathershawnComment #7
fathershawnAll tests passed
Comment #8
godotislate1 question on the MR about test coverage, otherwise this looks pretty good.
I also discussed with @longwave whether adding arguments to
boost()is a BC break we need to defer, but we agreed that it should be fine for the D12 beta period, and it's likely that Htmx hasn't been subclassed.Comment #9
godotislateOK, I think this is good then.
Comment #10
fathershawnThank you both. We can also update the CR for the change to htmx 4. Whether this was a late addition to the API change or I missed it entirely, with the change in the inheritance behavior boost is very impaired without this fix.
Comment #11
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue. It fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".
This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.
Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.
Comment #12
fathershawnFixed a test method docBlock for phpstan level 3. Self-returning to the previous RTBC
Comment #15
longwaveCommitted and pushed 8d0055d8dcc to main and d1917065194 to 12.0.x. Thanks!