jhu-idc / iDC-general

Contains non-code-base specific tickets relating to the Islandora8 for Digital Collection project
0 stars 0 forks source link

Media template renders inside item template #456

Closed jaredgalanis closed 2 years ago

jaredgalanis commented 2 years ago

@jabrah and I noticed that the media template was still rendering inside of the item template which causes some unexpected styling clashes. This was consistently happening before and was previously addressed in some bug fixes, but the present behavior is a bit more subtle and we only noticed it recently. This seems to happen immediately after the Drupal container boots up (i.e. right after running make reset or similar).

During normal use, the item page may render correctly. You can force the issue by:

There are various checks for whether an item template is being rendered or a media and it appears that the checks currently in place are non-deterministic in ascertaining which template is being rendered.

We should look for a more reliable way of checking for whether an item template is being rendered.

These checks occur in the idcui_preprocess_media hook in the idcui.theme file. They are then utilized in the media.html.twig template override in the theme.

This is an example of how the issue looks when it is occurring. The title, margin with gray inset and white boxing around the image in this example are all unexpected here in the item template.

Screen_Shot_2021-11-20_at_2_22_44_PM

jabrah commented 2 years ago

It seems like the preprocess_media hook isn't being fired when the rendering is broken. This causes some of the variables needed in the template to be missing, so it renders as you see in the screenshot above

jabrah commented 2 years ago

I also weirdly could not reproduce the issue when the Solr container was not running

jaredgalanis commented 2 years ago

closed by https://github.com/jhu-idc/idc-isle-dc/pull/300