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

Issue fork drupal-3630627

Command icon 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:

Comments

fathershawn created an issue. See original summary.

chaitanyadessai made their first commit to this issue’s fork.

chaitanyadessai’s picture

Status: Active » Needs review

Please review MR.

fathershawn’s picture

Well, 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.

fathershawn’s picture

fathershawn’s picture

All tests passed

godotislate’s picture

1 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.

godotislate’s picture

Status: Needs review » Reviewed & tested by the community

OK, I think this is good then.

fathershawn’s picture

Thank 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.

needs-review-queue-bot’s picture

Status: Reviewed & tested by the community » Needs work
StatusFileSize
new1.5 KB

The 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.

fathershawn’s picture

Status: Needs work » Reviewed & tested by the community

Fixed a test method docBlock for phpstan level 3. Self-returning to the previous RTBC

  • longwave committed d1917065 on 12.0.x
    fix: #3630627 Htmx::boost() is missing functionality for v.4
    
    By:...

  • longwave committed 8d0055d8 on main
    fix: #3630627 Htmx::boost() is missing functionality for v.4
    
    By:...
longwave’s picture

Version: main » 12.0.x-dev
Status: Reviewed & tested by the community » Fixed

Committed and pushed 8d0055d8dcc to main and d1917065194 to 12.0.x. Thanks!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.