Problem/Motivation

Three update hooks in vlsuite_block submodules reference bundle classes but these classes are not imported with use statements in their respective .install files. This causes database updates to fail when running drush updatedb.

The affected modules are:

  • vlsuite_block_icon
  • vlsuite_block_image
  • vlsuite_block_cta

When attempting to run database updates, the following errors occur:

[error]  Class "VLSuiteBlockIcon" not found
[error]  Update failed: vlsuite_block_icon_update_10003
[error]  Class "VLSuiteBlockImage" not found
[error]  Update failed: vlsuite_block_image_update_10002
[error]  Class "VLSuiteBlockCta" not found
[error]  Update failed: vlsuite_block_cta_update_10002

This blocks all pending database updates from running, preventing users from updating their sites properly.

Steps to reproduce

  1. Update VLSuite from 2.2.2 or older to 2.3.2
  2. Run drush updatedb or visit /update.php
  3. Observe the update hooks failing with "Class not found" errors

Proposed resolution

Add the missing use statements at the top of each affected .install file (after the file docblock, around line 7).

File: modules/vlsuite_block/modules/vlsuite_block_icon/vlsuite_block_icon.install

Add:

use Drupal\vlsuite_block_icon\Entity\Bundle\VLSuiteBlockIcon;

File: modules/vlsuite_block/modules/vlsuite_block_image/vlsuite_block_image.install

Add:

use Drupal\vlsuite_block_image\Entity\Bundle\VLSuiteBlockImage;

File: modules/vlsuite_block/modules/vlsuite_block_cta/vlsuite_block_cta.install

Add:

use Drupal\vlsuite_block_cta\Entity\Bundle\VLSuiteBlockCta;

Remaining tasks

None.

User interface changes

None.

API changes

None.

Data model changes

None.

Issue fork vlsuite-3556937

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

juanjol created an issue. See original summary.

juanjol’s picture

Assigned: Unassigned » juanjol

juanjol changed the visibility of the branch 3556937-ssing-use-statements to hidden.

juanjol changed the visibility of the branch 3556937-ssing-use-statements to active.

juanjol changed the visibility of the branch 3556937-ssing-use-statements to active.

juanjol’s picture

Title: ssing use statements in .install files cause update hooks to fail » Missing use statements in .install files cause update hooks to fail
juanjol’s picture

Issue summary: View changes
juanjol’s picture

Status: Active » Needs review

MR ready to review. Three files are fixed with the correct use statements.

eduardo morales alberti’s picture

Status: Needs review » Fixed

MR reviewed, fixed!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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