Skip to content

Alter attributes event - Reroll of pull/95 #103

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

stesi561
Copy link

Adds SetAttributesEvent Event that happens after attributes are created. This allows us to update the attributes in a Drupal Module by subscribing to this event.

Also changes two methods in the Drupal Helper from protected to public so they can be used via the Event Subscriber.

Reroll required due to 6ad28dd which also adds Aliases/Imports in a way that prevents an automatic merge.

j4-m and others added 3 commits July 18, 2025 09:05
Fix style warning:
    Immediately return this expression instead of
    assigning it to the temporary variable "$attributes".
Copy link

@stesi561
Copy link
Author

I'm guessing to merge you will probably want some test coverage included of this new functionality?

I'm not sure if @j4-m is still interested in this work.

We have a couple of clients using this functionality so I'm definitely keen to get merged. I can potentially look at adding some test coverage if required.

Potentially we could also think about the behaviour of the Event - should we be able to remove attributes or just alter and add new ones.

Currently the Event Subscriber can remove attributes. I'm not sure if this is desirable behaviour? Perhaps instead of returning the attributes as set on the event after it returns from dispatch we should merge in the attributes returned?

@stesi561
Copy link
Author

Hmm. Interesting we now fail. Strange.

I think will need to dig into this more.

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.

2 participants