Skip to content
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

Use the correct preprocess hook for paragraph item #111

Merged
merged 2 commits into from
Dec 5, 2021

Conversation

argiepiano
Copy link
Contributor

Fixes #110

In order for the fix to work you MUST also apply #109

@laryn laryn merged commit 067067d into backdrop-contrib:1.x-1.x Dec 5, 2021
@laryn
Copy link
Member

laryn commented Dec 5, 2021

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!

@argiepiano
Copy link
Contributor Author

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.

@argiepiano argiepiano deleted the 1.x-issue-110 branch December 5, 2021 15:20
@argiepiano
Copy link
Contributor Author

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

@laryn
Copy link
Member

laryn commented Dec 5, 2021

@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
Copy link
Contributor Author

@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

@laryn
Copy link
Member

laryn commented Dec 6, 2021

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

@argiepiano
Copy link
Contributor Author

@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!

@laryn
Copy link
Member

laryn commented Dec 6, 2021

@argiepiano Sounds tangly!

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.

Use the correct preprocess function to add the modal administration
2 participants