Yes, I can confirm, this is still happening.
As said by @donquixote → , maybe this is not impacting the module itself cause Drupal is able to load it by its own, but it is appearing when including custom namespaces inside a docroot src/ folder.
Could be this is related to an old renaming of this module from drupal/emr into drupal/entity_meta_relation?Thanks in advance.
- 🇧🇪Belgium keszthelyi Brussels
I also have the same issue, emr messing up the top level src directory custom project namespace, causing
PHP Fatal error: Cannot declare class...
errors for certain scripts.I digged into the composer autoload generation, and after some debugging, I found that in my case it was not this module that caused the issue, but the fact that this module was a dependency for another module (OE Listing page). That module is requiring a metapackage called 'emr', that doesn't have an install path, because of this an empty string will be used by composer in the packageMap here, and that results in the
'Drupal\\emr\\' => array($baseDir . '/src')
, in the autoload file.Not sure in what context others have this problem, but after I found this, I installed the module alone (not as a dependency), and could not reproduce the issue anymore.
I ended up replacing the emr metapackage and requiring entity_meta_relation directly in my project's composer.json to be able to use the module.
Hey @keszthelyi → could you please confirm, then if requiring drupal/entity_meta_relation you have an entry for it in composer autoload_psr4 or if it is working by being loaded by Drupal itself?
I guess, then that issue should be reported as an issue about the dependency definition for oe_list_pages.- 🇧🇪Belgium keszthelyi Brussels
Hi @joanpebupe, when requiring drupal/entity_meta_relation directly, then there's no entry in autoload_psr4.php and it's working by being loaded by Drupal. Yes, I'm planning to report this on oe_list_pages.
Hi @keszthelyi, I guess then that if oe_lists_pages fixes its dependcy to request drupal/entity_meta_relation instead of drupal/emr that issue could be closed as seems that module (by its own) would be working as expected.
Issue opened in oe_list_pages side: https://github.com/openeuropa/oe_list_pages/issues/176