- Issue created by @geoffreyr
- Status changed to Needs review
about 1 year ago 12:35am 7 November 2023 - π¦πΊAustralia geoffreyr
Added a MR for branch
3399722-module-installation-fails
. This adds checks for the various forms during the installer and logs a warning when they're not found.Unfortunately this doesn't get to the root cause of why a media type might not have that form; I need to do some more investigation. However, I hope this might help someone else with the same problem.
- πΊπΈUnited States theMusician
Thank you. We'll review this soon. I appreciate the report and an idea of at least helping work around the issue while we figure out why.
I think the standard profile includes media but if another profile is used it would be possible for media not to be enabled. I have also seen sites that were not D9 originally, so those upgraded from prior versions where media types are not necessarily named the same because one had to create them manually in the past. This is especially true for local video types.
- πΊπΈUnited States theMusician
@geofferyr can you outline in more detail how you found and replicated this error? I did a fresh install, and deleted the local and video media types. I deleted their entity form configs via drush and the installs still worked with your code, but no error message was ever logged. I tried it with just one media type deleted and then deleting the config and it was reinstalled upon enabling able player.
Thank you
- π¦πΊAustralia geoffreyr
@theMusician We already had an extensive code and config base for the site we were adding Ableplayer to, so this will probably be hard to replicate. Thanks for testing the patch out, it is odd that nothing got logged even when you specifically removed the form displays. I'll see if I can find time to put together an example.
- π¦πΊAustralia geoffreyr
Digging deeper into this. I'm seeing the following fired off during an install of the Ableplayer module.
$form = \Drupal::entityTypeManager()->getStorage('entity_form_display')->load('media.' . $bundle->get('id') . '.default');
Causes the exception
Missing required properties for an EntityDisplay entity.
to be thrown. The contents of the values it is sent are as follows:Array ( [content] => Array ( [field_ableplayer_media_caption] => Array ( [type] => media_library_widget ) ) )
EntityDisplayBase expects a targetEntityType and bundle property to be present as well. But I'm not sure where it's supposed to be coming from; and this is during a load method call to boot. It's not cached the old config, and ableplayer's formatter isn't even present in the config table. Very odd.
- πΊπΈUnited States theMusician
Thank you for the additional information. I have seen inconsistent behavior on sites built prior to 8 including media. Your note about the install profile makes me think you discovered what was causing that.
Most of the config is stored in the optional directory so maybe since it is looking at a prior installed site the config is not being pulled in? It should on the first and subsequent installs of the module but it seems like it is being skipped from your digging.
Able player media caption is distinct in case sites are doing translation, it lets you load the caption files in many languages.
I think the patch is a good path forward, especially if this is an edge case, if it is. With your patch, after install does everything work properly once you create the form?
-
theMusician β
committed 08e236cb on 3.x authored by
geoffreyr β
Issue #3399722 by geoffreyr: Module installation fails under some...
-
theMusician β
committed 08e236cb on 3.x authored by
geoffreyr β
- Status changed to Fixed
about 1 year ago 6:09pm 1 December 2023 - πΊπΈUnited States theMusician
Thank you for the work on this issue.
Automatically closed - issue fixed for 2 weeks with no activity.