Problem/Motivation
workflow_buttons.module's workflow_buttons_entity_view() has an assertion for \Drupal::service('entity.form_builder'); to be an instance of Drupal\Core\Form\FormBuilder, but that service instead returns an instance of Drupal\Core\Entity\EntityFormBuilder, causing an error.
Steps to reproduce
Upgrade to the latest dev release and try visiting a page that calls workflow_buttons_entity_view(). Page load will fail with error:
AssertionError: assert($form_builder instanceof FormBuilder) in assert() (line 117 of /var/www/html/docroot/sites/default/modules/contrib/workflow_buttons/workflow_buttons.module).
Proposed resolution
Update the assertion to instead expect an instance of Drupal\Core\Entity\EntityFormBuilderInterface.
See also #3451409: Automated Drupal 11 compatibility fixes for workflow_buttons MR #13 which considers this new to Drupal 11, though it is present in Drupal 10 as well. Propose making the same changes as in this commit, but separate from Drupal 11 readiness topic.
Remaining tasks
None.
User interface changes
None.
API changes
None.
Data model changes
None.
Issue fork workflow_buttons-3515416
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 #3
daletrexelPlease also credit @ultrabob for also proposing this change in #3451409: Automated Drupal 11 compatibility fixes for workflow_buttons, although the problem exists in Drupal 10 with the latest dev release of this module.
Comment #4
alexdmccabeIt looks like this may have been fixed already: https://git.drupalcode.org/project/workflow_buttons/-/commit/b01dfcd2408...
Comment #6
mlncn commentedYes it was! And then in #3523277: Clean up any remaining code issues for a Drupal 11 Release the @var line with a missing asterisk was removed, and i think is redundant with the assertion in most IDEs.