- Issue created by @johnjw59@gmail.com
- 🇨🇦Canada johnjw59@gmail.com
Here's the promised patch. I left the
drupal_static
key as-is as others may already be targeting it and I didn't want to introduce any breakages. - Status changed to Needs work
6 months ago 2:25am 23 June 2024 - 🇦🇺Australia darvanen Sydney, Australia
Yeah sure, looks good to me and happy to support that. If you could just document it in the readme please?
Ideally this would have a test too now that we're finally starting to build out a suite of them.
Also patches are becoming a thing of the past, please feel free to make a merge request :)
- 🇨🇦Canada johnjw59@gmail.com
After using the patch I provided in #2 for a bit, I don't think it's the right approach. Making the data in the cached variable an array leads to it bloating as each field just adds to the array, never cleaning it out. This can lead to some content having the wrong entity passed to the token method.
I think a better approach is to just add an alter there allowing other modules to tweak the data array before it gets passed to the token method. Attached is a patch doing just that (no interdiff as it's a completely different approach). This is also just a must simpler solution I feel.
@darvanen - I will add further documentation and roll a proper MR with this tweak once I have some spare time!
- 🇨🇦Canada johnjw59@gmail.com
Whoops, missed instantiating the module handler service in that last patch. Here's the correct one!
- 🇦🇺Australia darvanen Sydney, Australia
Wonderful, thanks for following up with that :)