Problem/Motivation

I would like to alter the CSHS option items. E.g. altering the labels for additional information.

Steps to reproduce

Try to alter the label of an item of CshsOption. You'll fail.

Proposed resolution

Introduce a simple hook.

Issue fork cshs-3560350

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

jepster_ created an issue. See original summary.

jepster_’s picture

Status: Active » Needs review

Please review the MR.

joseph.olstad made their first commit to this issue’s fork.

liam morland made their first commit to this issue’s fork.

joseph.olstad’s picture

Would be best if this was using dependency injection as I attempted to do prior to the last commit. Appreciate it if someone fixed this.

joseph.olstad’s picture

@lkmorlan, I see your change blasted my commits completely and the history of changes (using git rebase I assume). While my change failed the test, we're now back to non-Dependency Injection.

liam morland’s picture

Version: 4.0.3 » 4.0.x-dev

The previous version of the merge request automatically gets tagged so nothing is lost.

I have added dependency injection to the merge request.

Update: Sorry, I thought it was using the autowire trait because there is no ::create(). CshsOption should be a service so that there is a way to do the injection.

joseph.olstad’s picture

@lkmorland, I believe you've possibly enabled rebase by default in your local git configuration which likely explains what happened to my commits (zapped). I purposely disable rebase with the FALSE option and only use it explicitly which is extremely rare.

With that said ya it's not working and yes probably CshsOption needs refactoring to become a service.

liam morland’s picture

Nothing has been lost. The tag previous/3560350-introduce-hook-for/2025-12-05-1 is pointing to what it was like before I pushed. That version does not have fully-implmented dependency injection. That is why tests do not pass on that version.

I suggest that this be done without dependency injection. Conversion to a service with dependency injection can be done in a follow-up.

  • joseph.olstad committed 3566feb7 on 4.0.x
    feat: #3560350 Introduce hook for altering CSHS option item
    
    By:...
joseph.olstad’s picture

Status: Needs review » Fixed

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.

joseph.olstad’s picture

Status: Fixed » Closed (fixed)

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