unlcms / project-herbie

Drupal 10 implementation at the University of Nebraska–Lincoln
https://cms.unl.edu
GNU General Public License v2.0
6 stars 6 forks source link

Creating a Tandem and adding a Button Link to it during the initial creation step causes an error, #740

Closed ericras closed 2 months ago

ericras commented 3 months ago

Creating a Tandem and adding a Button Link to it during the initial creation step causes an error, and breaks the layout tab permanently on the page

line 356 of unl_five_herbie.theme

$tandem_block_entity = $variables['element']['#object']->getParentEntity()

seems like until the layout builder page is saved, the tandem block hasn’t officially been created yet, so getParentEntity doesn’t work

quick solution is that i put on production is to wrap the rest of the code in if ($tandem_block_entity) { but that means the dcf-button classes don’t get applied in the preview until the page is saved.

i don’t know if there’s a better solution