backdrop-contrib / paragraphs

Paragraphs module to control your content flow
https://backdropcms.org/project/paragraphs
GNU General Public License v2.0
5 stars 11 forks source link

Use the correct preprocess function to add the modal administration #110

Closed argiepiano closed 2 years ago

argiepiano commented 2 years ago

This relates to #91 - specifically see my comment https://github.com/backdrop-contrib/paragraphs/issues/91#issuecomment-986095491

Preprocessing of Entity Plus entities is confusing. One would logically assume that the following preprocess hook would work: template_preprocess_paragraphs_item() to preprocess paragraph items. But no. These preprocessing functions never get called. Which is what led people to use #theme_wrappers (to force that hook to run, but caused other issues). This also led a previous PR to use paragraphs_preprocess() to add the modal classes. Instead, you must use hook_preprocess_entity_plus and use if statements to check that you are preprocessing the right template/entity.

I will submit a PR in a minute.

IMPORTANT. For the PR to work you must:

argiepiano commented 2 years ago

PR #111

Please test