Problem/Motivation

We failed to fully deprecated entity_reference module in 8.8.x, this means it needs to stay in 9.0.x so it can be properly uninstalled.

However we should make the module as minimal as possible and add an early update to uninstall it so we can actually do the removal in 10.0.x

Proposed resolution

1. Add a hook_requirements() to prevent entity_reference from being installed.

2. Add hidden: TRUE to .info.yml so the module can't be seen in the UI.

3. Add a post update to system module to uninstall the module.

4. Remove all of the deprecated code.

Critical because once #3062302: Properly deprecate the entity reference module lands it is going to add deprecations we then need to remove again, but this issue doesn't really depend on that one.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

CommentFileSizeAuthor
#5 3111645-5.patch4.95 KBbobbygryzynger

Comments

catch created an issue. See original summary.

catch’s picture

Priority: Major » Critical
gábor hojtsy’s picture

bobbygryzynger’s picture

Assigned: Unassigned » bobbygryzynger
bobbygryzynger’s picture

StatusFileSize
new4.95 KB

1. Added this, although it doesn't seem to prevent Drush 10.x from installing the module. See https://github.com/drush-ops/drush/issues/3669
2. This was already present, so no changes here.
3. Added this.
4. Did this. The only remaining files are entity_reference.install and entity_reference.info.yml.

bobbygryzynger’s picture

Assigned: bobbygryzynger » Unassigned
Status: Active » Needs review
catch’s picture

Status: Needs review » Reviewed & tested by the community

This is already marked hidden in .info.yml, so I think we're ready here.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed 46c8fe7 and pushed to 9.0.x. Thanks!

There was a very simple to fix conflict in core/modules/system/system.post_update.php due to the Simpletest removal - fixed on commit.

  • alexpott committed 46c8fe7 on 9.0.x
    Issue #3111645 by bobbygryzynger, catch: Uninstall entity_reference...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

mikemadison’s picture

FYI I just performed the 9.3 update and this was still on in my configuration. I may have missed an update previously that disabled it? But for whatever reason, this needed to be manually removed from my core.extension config to disable after the drupal 9.3 update!

theuni’s picture

When running drush site-install (drush 10.6.2) for a fresh installation of D 9.3 I get

In ModuleInstaller.php line 126:
                                                                     
  [Drupal\Core\Extension\Exception\ObsoleteExtensionException]       
  Unable to install modules: module 'entity_reference' is obsolete.

I do not have any config exported yet, what can be done?

gábor hojtsy’s picture

@mikemadison: the code in system_post_update_uninstall_entity_reference_module() in the committed change should have uninstalled it.

@theuni: Would be good to know how did entity_reference ended in the modules to install list? It is not included by default.

theuni’s picture

@gábor I'm installing contenta cms via composer create-project contentacms/contenta-jsonapi-project.

Any hint where to manually remove entity_reference from this repository before using composer create-project and drush si?

gábor hojtsy’s picture

@theuni: Well contenta is not quite the same as Drupal 9.3 :D Please open an issue with Contenta to remove the entity refenrece module requirement in their codebase. The module's code has been integrated in the base system of Drupal and the module was an empty shell at best for quite a while.

theuni’s picture

@gábor thanks, I've opened an issue.