Upgrading from beta1 to beta2 returns an error on update.php results:

poll module
Update #8001

Failed: Drupal\Core\Database\SchemaObjectDoesNotExistException: Cannot change the definition of field poll__choice.choice_chid: field doesn't exist. in Drupal\Core\Database\Driver\mysql\Schema->changeField() (line 525 of /home/udcadmin/public_html/udc.global/core/lib/Drupal/Core/Database/Driver/mysql/Schema.php).

Drupal 8.06

Comments

shadowmihai created an issue. See original summary.

matthias_bauw’s picture

I can confirm this.

berdir’s picture

That's because that update function was added too late. If you installed beta1 and not an earlier version, then there's nothing you need to do.

I can't change anything about beta2, I'd have to release a new beta3 to change something.

For now, you can run this: "drupal_set_installed_schema_version('poll', 8001)". With drush ev, or if you can't use drush just put it at the end of index.php, access the site once and then remove it again.

berdir’s picture

To work around this, we need to add a new check by calling \Drupal::entityDefinitionUpdateManager()->getEntityType('poll_choice') and if that already exists, return early.

johnchque’s picture

Status: Active » Needs review
StatusFileSize
new516 bytes

Tested manually, added work around suggested on #4

johnchque’s picture

[Duplicated]

johnchque’s picture

Version: 8.x-1.0-beta2 » 8.x-1.x-dev
Assigned: Unassigned » johnchque
StatusFileSize
new528 bytes

Discussed with @Berdir, changed the check. Tested manually and it works good. :)

johnchque’s picture

StatusFileSize
new584 bytes
new525 bytes

Sorry, needed to fix a space, also added a comment.

berdir’s picture

Title: Update returns errors » poll_update_8001() fails when installed with beta1

  • Berdir committed 276672b on 8.x-1.x authored by yongt9412
    Issue #2703091 by yongt9412: poll_update_8001() fails when installed...
berdir’s picture

Status: Needs review » Fixed

Thanks, committed.

shadowmihai’s picture

Yes, does seem to work now thanks!

Status: Fixed » Closed (fixed)

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