Problem/Motivation
A fresh Varbase install (full profile) fatals during module installation:
Error: Class "Drupal\access_unpublished\AccessUnpublished" not found in varbase_workflow__grant_access_unpublished_permissions() (line 49 of includes/helpers.inc)varbase_workflow.info.yml lists access_unpublished under the soft install: key, not the hard dependencies: key:
dependencies: - drupal:workflows - drupal:content_moderation install: - scheduler_content_moderation_integration - admin_audit_trail_workflows - access_unpublished - eca_workflow - smart_trim
includes/helpers.inc has use Drupal\access_unpublished\AccessUnpublished; at the top and calls AccessUnpublished::applicableEntityType() directly inside varbase_workflow__grant_access_unpublished_permissions(), with no \Drupal::moduleHandler()->moduleExists('access_unpublished') or class_exists() guard. When this runs during module install before access_unpublished's classes are registered/available, the site install aborts entirely.
Steps to reproduce
Fresh drush site:install varbase, then drush pm:enable varbase_workflow --yes (or the equivalent Varbase "full" install flow) — the module install fatals with the class-not-found error above.
Proposed resolution
Either:
- Move
access_unpublishedfrominstall:todependencies:invarbase_workflow.info.ymlso Drupal's dependency resolver guarantees it is fully enabled (with its classes autoloadable) beforevarbase_workflow's own install hooks run, or - Guard the call in
varbase_workflow__grant_access_unpublished_permissions()with a\Drupal::moduleHandler()->moduleExists('access_unpublished')check before referencing theAccessUnpublishedclass.
Remaining tasks
- ✅ File an issue about this project
- ❌ Addition/Change/Update/Fix to this project
- ❌ Testing to ensure no regression
- ➖ Automated unit/functional testing coverage
- ➖ Developer Documentation support on feature change/addition
- ➖ User Guide Documentation support on feature change/addition
- ➖ UX/UI designer responsibilities
- ➖ Accessibility and Readability
- ❌ Reviewed by a human
- ❌ Code review by maintainers
- ❌ Full testing and approval
- ❌ Credit contributors
- ❌ Review with the product owner
- ❌ Update Release Notes
- ❌ Release
User interface changes
- N/A
API changes
- N/A
Data model changes
- N/A
Release notes snippet
- Fixed a fatal error installing Varbase Workflow when the Access Unpublished module's class was referenced before it was guaranteed to be available.
Issue fork varbase_workflow-3609084
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
Comment #2
rajab natshah