Closed argiepiano closed 2 years ago
Thank you @argiepiano -- much appreciated all the digging on this one. I'll just have to make a prominent warning about the other hook no longer working at all when I release this. Your work does make sense!
I'll just have to make a prominent warning about the other hook no longer working at all when I release this. Your work does make sense!
Eventually we may want to take a look at how Entity Plus handles the theming of custom entities such as Paragraphs.
Another option while we look into how entity plus handles entity viewing, would have been to implement hook_entity_plus_view and change the theme right there. I believe that would have allowed us to use the paragraph_item preprocess function.
Yet a third way to avoid using hook_preprocess_entity_plus and use preprocess_paragraphs_item would have been for Paragraphs to extend class EntityPlusController
to implement buildContent, and specify the theme to be used to display Paragraphs. I noticed that Paragraphs doesn't extend EntityPlusController
at all, and therefore relies on its method to build content and theme the paragraph entity
@argiepiano Ah, interesting. That third way sounds like a good option actually -- that would allow things to function the way many people assume they should, right?
@argiepiano Ah, interesting. That third way sounds like a good option actually -- that would allow things to function the way many people assume they should, right?
Right. I can take a stab at that later today and test. It shouldn't be too involved
That sounds great. I was about to start reworking Classy Paragraphs (since it uses hook_preprocess_paragraphs_item
but if this is achievable in the short term I'll pause on that. (Would be nice not to have to tell everyone to rewrite custom functions they may be using on the next update, too).
@laryn I did not have a chance to try this last night, but I'll try tonight. Got entangled with Entity Plus, cleaning up the taxonomy term and vocabulary wrappers!
@argiepiano Sounds tangly!
Fixes #110
In order for the fix to work you MUST also apply #109