Using the walk-through in the two comments #2470185-11: [meta] Provide a 8.0.0-beta9 to 8.0.0-beta10 upgrade path and #2470185-17: [meta] Provide a 8.0.0-beta9 to 8.0.0-beta10 upgrade path I attempted to run the update from 8.0.0-beta9 to beta10. It ran 4 of the 12 updates but failed on 81000 with the following error:

Failed: Drupal\Component\Plugin\Exception\PluginNotFoundException: The "taxonomy_term_reference_link" plugin does not exist. in Drupal\Core\Plugin\DefaultPluginManager->doGetDefinition() (line 57 of /var/www/site/docroot/core/lib/Drupal/Component/Plugin/Discovery/DiscoveryTrait.php).

Since it failed there, that and the subsequent updates didn't run and taxonomy references weren't converted.

Here's the sequence I went through:

  1. Cloned head2head.
  2. Enabled head2head and beta2beta.
  3. Set the last version as beta9 at admin/config/development/beta2beta
  4. Updated code base to beta10, including copying changes to default.services.yml and default.settings.php to the live versions of those.
  5. Rebuilt cache (drush cr -y).
  6. Re-logged in.
  7. Visited update.php and ran 12 listed updates. Got the error shown above.
  8. Rebuilt cache (drush cr -y) again.
  9. Took the site out of maintenance mode.
  10. When I visited a node-edit form with a taxonomy reference, I got a site error. The error log indicated that the taxonomy reference hadn't been updated.
  11. Visited update.php again and there were 8 updates left.
  12. Ran the updates and got the same error.

At that point I was stuck.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

rootwork’s picture

So I tried enabling beta2beta and running update.php prior to updating the codebase to b10. In that case, there were 9 updates to run, but it still got stuck on 81000 and gave me the same error. When I then updated the code, rebuilt the cache, and went to update.php again, there were still 12 updates to run (same as the first time around) and it once again got stuck on 81000.

Let me know if there's any more information I can provide.

amateescu’s picture

Sounds like you have an entity base field using the old taxonomy formatter that was removed in #1847596: Remove Taxonomy term reference field in favor of Entity reference.

Can you please try to search your codebase for 'taxonomy_term_reference_link' and post the results here?

amateescu’s picture

A bit more information on that: head2head_1847596() only updates *configurable fields* (those that are created through Field UI or with default config). If there is any code that's using / referencing the old formatter (like an entity base field), the code has to be updated manually :)

amateescu’s picture

Status: Active » Postponed (maintainer needs more info)
rootwork’s picture

Status: Postponed (maintainer needs more info) » Active

Thanks for your help!

Yes, it's definitely about taxonomy reference fields that need to be updated. Everything was configured through the UI, then exported to config -- I didn't create any fields through custom modules, if that's what you mean.

taxonomy_term_reference_link shows up in a bunch of places in the exported config (staging) but since Drupal isn't reading from that and it would get overwritten on the next export I presume that isn't an issue.

Other places taxonomy_term_reference_link shows up after updating the codebase to beta10--

In core/modules/taxonomy/tests/upgrade/drupal-7.taxonomy.database.php:

   44  db_update('field_config_instance')
   45    ->fields(array(
   46:     'data' => 'a:7:{s:5:"label";s:4:"Tags";s:11:"description";s:63:"Enter a comma-separated list of words to describe your content.";s:6:"widget";a:5:{s:6:"weight";i:-4;s:4:"type";s:21:"taxonomy_autocomplete";s:6:"module";s:8:"taxonomy";s:6:"active";i:0;s:8:"settings";a:2:{s:4:"size";i:60;s:17:"autocomplete_path";s:21:"taxonomy/autocomplete";}}s:7:"display";a:2:{s:7:"default";a:5:{s:4:"type";s:28:"taxonomy_term_reference_link";s:6:"weight";i:10;s:5:"label";s:5:"above";s:8:"settings";a:0:{}s:6:"module";s:8:"taxonomy";}s:6:"teaser";a:5:{s:4:"type";s:28:"taxonomy_term_reference_link";s:6:"weight";i:10;s:5:"label";s:5:"above";s:8:"settings";a:0:{}s:6:"module";s:8:"taxonomy";}}s:8:"settings";a:1:{s:18:"user_register_form";b:0;}s:8:"required";i:0;s:13:"default_value";a:1:{i:0;a:8:{s:3:"tid";s:1:"2";s:3:"vid";s:1:"1";s:4:"name";s:12:"Default term";s:11:"description";s:0:"";s:6:"format";s:13:"filtered_html";s:6:"weight";s:1:"0";s:23:"vocabulary_machine_name";s:4:"tags";s:11:"rdf_mapping";a:5:{s:7:"rdftype";a:1:{i:0;s:12:"skos:Concept";}s:4:"name";a:1:{s:10:"predicates";a:2:{i:0;s:10:"rdfs:label";i:1;s:14:"skos:prefLabel";}}s:11:"description";a:1:{s:10:"predicates";a:1:{i:0;s:15:"skos:definition";}}s:3:"vid";a:2:{s:10:"predicates";a:1:{i:0;s:13:"skos:inScheme";}s:4:"type";s:3:"rel";}s:6:"parent";a:2:{s:10:"predicates";a:1:{i:0;s:12:"skos:broader";}s:4:"type";s:3:"rel";}}}}}')
   47    )
   48    ->condition('field_name', 'field_tags')

In core/scripts/generate-d7-content.sh:

  108        'display' => array(
  109          'default' => array(
  110:           'type' => 'taxonomy_term_reference_link',
  111            'weight' => 10,
  112          ),
  113          'teaser' => array(
  114:           'type' => 'taxonomy_term_reference_link',
  115            'weight' => 10,
  116          ),

and that's it.

amateescu’s picture

Status: Active » Needs review
FileSize
3.04 KB

Hmm, that means some code is trying to instantiate an old taxonomy formatter in update.php, which should not happen normally. Can you try to see if this patch helps?

You need to apply it to the head2head module, clear the caches and then go to update.php and run the updates again :)

alexpott’s picture

FileSize
1.83 KB
4.57 KB

And there is a widget too.

amateescu’s picture

Status: Needs review » Fixed
FileSize
4.59 KB
3.21 KB

I'm really curious how can a field widget be instantiated in update.php, that sounds pretty crazy :) Can someone please post a backtrace of that?

Anyway, it doesn't really hurt anything to also have the widget override and, apparently, @alexpott also hit this bug when he tried to update a D8 site, so I committed the patch attached to 8.x-1.x. Thanks everyone!

  • amateescu committed eaaa939 on 8.x-1.x
    Issue #2482357 by alexpott, amateescu, rootwork: beta2beta b9-b10 fails...
rootwork’s picture

Took me awhile to circle back to testing this again, but I did and it works great. Thanks SO much for addressing this! Really appreciate it.

Status: Fixed » Closed (fixed)

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