This happens on cache clear, or right after install.
Here's the full stacktrace:
Drupal\Core\Entity\EntityType->hasHandlerClass('form') (Line: 240)
panopoly_media_entity_type_alter(Array, NULL, NULL) (Line: 539)
Drupal\Core\Extension\ModuleHandler->alter('entity_type', Array) (Line: 366)
Drupal\Core\Plugin\DefaultPluginManager->alterDefinitions(Array) (Line: 134)
Drupal\Core\Entity\EntityTypeManager->findDefinitions() (Line: 175)
Drupal\Core\Plugin\DefaultPluginManager->getDefinitions() (Line: 796)
Drupal\Core\Entity\EntityManager->getDefinitions() (Line: 237)
Drupal\Core\Extension\ModuleInstaller->install(Array, 1) (Line: 83)
Drupal\Core\ProxyClass\Extension\ModuleInstaller->install(Array) (Line: 92)
Drupal\panopoly\Installer\Form\PanopolyDemoInstallerForm->submitForm(Array, Object)
call_user_func_array(Array, Array) (Line: 111)
Drupal\Core\Form\FormSubmitter->executeSubmitHandlers(Array, Object) (Line: 51)
Drupal\Core\Form\FormSubmitter->doSubmitForm(Array, Object) (Line: 590)
Drupal\Core\Form\FormBuilder->processForm('panopoly_demo_installer_form', Array, Object) (Line: 319)
Drupal\Core\Form\FormBuilder->buildForm('panopoly_demo_installer_form', Object) (Line: 954)
install_get_form('Drupal\panopoly\Installer\Form\PanopolyDemoInstallerForm', Array) (Line: 624)
install_run_task(Array, Array) (Line: 577)
install_run_tasks(Array, NULL) (Line: 118)
install_drupal(Object) (Line: 44)
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | panopoly_media-entity_info_error-3061339-6.patch | 788 bytes | kerasai |
Comments
Comment #2
dsnopekComment #3
kerasai commented@dsnopek, I'm not able to reproduce this using a composer-installed Panopoly at either a658578 (from 6/12/2019) d5032aa (current).
I see in the code where this would be happening, but this case has not occurred with my testing. Is there anything notable about your setup or installation? I've got just a clean install via the UI as well as drush, with the demo content.
Regarding the cause of the error, I suspect there's a module altering the entity types, perhaps with via
hook_entity_type_alter, but it's improperly setting the file entity's form handler class to an array instead of a string. The error then culminates inpanopoly_mediawhen it attempts to add the delete form onpanopoly_media:240.Comment #4
dsnopekSo, I just did a fresh
composer create-projectand I'm still getting this error. :-(In case it matters, I've got Drupal 8.7.3 with PHP 7.2.
And, also, I think it may actually be possible for handler classes to be arrays. There is this
$nestedparameter toEntityType::hasHandlerClass()which has something to do with them being array's, but I don't totally understand it.Comment #5
dsnopekYeah, looking at the code in panopoly_media.module, shouldn't this bit:
... be changed to something like:
Comment #6
kerasai commentedI'm running the same versions, but still have yet to see this error in logs/console or while step debugging. The condition that triggers that warning will only occur if the file entity has form handlers set, which for me it does not.
Anyhow, see attached patch for a fix. This should clear up the problem. It's a bit clunky, because, of course, there is no direct way to obtain the form handlers (will throw same warning) so we have to obtain all of the handlers and deal with it that way.
Comment #8
dsnopekThat totally fixes it for me! Committed, thanks :-)