Automated Drupal 11 compatibility fixes for workflow_buttons

Created on 30 May 2024, 10 months ago

Problem/Motivation

Hello project maintainers,

This is an automated issue to help make this module compatible with Drupal 11.

Changes will periodically be added to this issue that remove deprecated API uses. To stop further changes from being posted, change the status to anything other than Active, Needs review, Needs work or Reviewed and tested by the community. Alternatively, you can remove the "ProjectUpdateBotD11" tag from the issue to stop the bot from posting updates.

The changes will be posted by the Project Update Bot β†’ official user account. This account will not receive any issue credit contributions for itself or any company.

Proposed resolution

You have a few options for how to use this issue:

  1. Accept automated changes until this issue is closed

    If this issue is left open (status of Active, Needs review, Needs work or Reviewed and tested by the community) and the "ProjectUpdateBotD11" tag is left on this issue, new changes will be posted periodically if new deprecation fixes are needed.

    As the Drupal Rector project improves and is able to fix more deprecated API uses, the changes posted here will cover more of the deprecated API uses in the module.

    Patches and/or merge requests posted by others are ignored by the bot, and general human interactions in the issue do not stop the bot from posting updates, so feel free to use this issue to refine bot changes. The bot will still post new changes then if there is a change in the new generated patch compared to the changes that the bot posted last. Those changes are then up to humans to integrate.

  2. Leave open but stop new automated changes.

    If you want to use this issue as a starting point to remove deprecated API uses but then don't want new automated changes, remove the "ProjectUpdateBotD11" tag from the issue and use it like any other issue (the status does not matter then). If you want to receive automated changes again, add back the "ProjectUpdateBotD11" tag.

  3. Close it and don't use it

    If the maintainers of this project don't find this issue useful, they can close this issue (any status besides Active, Needs review, Needs work and Reviewed and tested by the community) and no more automated changes will be posted here.

    If the issue is reopened, then new automated changes will be posted.

    If you are using another issue(s) to work on Drupal 11 compatibility it would be very useful to other contributors to add those issues as "Related issues" when closing this issue.

Remaining tasks

Using the patches

  1. Apply the latest patch in the comments by Project Update Bot β†’ or human contributors that made it better.
  2. Thoroughly test the patch. These patches are automatically generated so they haven't been tested manually or automatically.
  3. Provide feedback about how the testing went. If you can improve the patch, post an updated patch here.

Using the merge request

  1. Review the merge request and test it.
  2. Thoroughly test the changes. These changes are automatically generated so they haven't been tested manually or automatically.
  3. Provide feedback about how the testing went. If you can improve the merge request, create a new branch and merge request and work from there.

Warning: The 'project-update-bot-only' branch will always be overwritten. Do not work in that branch!

Providing feedback

If there are problems with one of the changes posted by the Project Update Bot β†’ , such as it does not correctly replace a deprecation, you can file an issue in the Drupal Rector issue queue β†’ . For other issues with the bot, for instance if the issue summary created by the bot is unclear, use the Project analysis issue queue β†’ .

πŸ“Œ Task
Status

Active

Version

1.0

Component

Code

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @project update bot
  • Open on Drupal.org β†’
    Core: 9.5.x + Environment: PHP 8.0 & MySQL 5.7
    last update 10 months ago
    Waiting for branch to pass
  • This is an automated patch generated using Upgrade Status and Drupal Rector. Please see the issue summary for more details. A merge request (MR) is also openend and updated.

    It is important that any automated tests available are run and that you manually test the changes.

    Drupal 11 Compatibility

    According to the Upgrade Status module β†’ these changes make this module compatible with Drupal 11! πŸŽ‰
    Therefore these changes update the info.yml file for Drupal 11 compatibility.

    Leaving this issue open, even after committing the current patch or merging the MR, will allow the Project Update Bot β†’ to post additional Drupal 11 compatibility fixes as they become available in Drupal Rector.

    Debug information

    Bot run #11-185727

    These packages were used to generate the fixes:

    1. drupal/upgrade_status: 4.3.1
    2. mglaman/phpstan-drupal: 1.2.11
    3. palantirnet/drupal-rector: 0.20.1
  • Status changed to Needs review 10 months ago
  • Open on Drupal.org β†’
    Core: 9.5.x + Environment: PHP 8.0 & MySQL 5.7
    last update 10 months ago
    Waiting for branch to pass
  • This is an automated patch generated using Upgrade Status and Drupal Rector. Please see the issue summary for more details. A merge request (MR) is also openend and updated.

    It is important that any automated tests available are run and that you manually test the changes.

    Drupal 11 Compatibility

    According to the Upgrade Status module β†’ these changes make this module compatible with Drupal 11! πŸŽ‰
    Therefore these changes update the info.yml file for Drupal 11 compatibility.

    Leaving this issue open, even after committing the current patch or merging the MR, will allow the Project Update Bot β†’ to post additional Drupal 11 compatibility fixes as they become available in Drupal Rector.

    Debug information

    Bot run #11-188815

    These packages were used to generate the fixes:

    1. drupal/upgrade_status: 4.3.2
    2. mglaman/phpstan-drupal: 1.2.11
    3. palantirnet/drupal-rector: 0.20.2
  • Pipeline finished with Success
    10 months ago
    Total: 147s
    #189305
  • First commit to issue fork.
  • πŸ‡―πŸ‡΅Japan ultrabob Japan

    I tested this with Drupal 11, and ran into an error when using the widget in the display due to the assert asserting the wrong type. I've fixed that issue, and tested that the module now works as expected with Drupal 11.

  • πŸ‡ͺπŸ‡ΈSpain Joseminosa

    When using the Gin theme, in the new update of the theme version 8.x-3.0-rc14 β†’ , the buttons appear hidden in the "More actions" dropdown, which is not intuitive.

    The Cannot opt out buttons using #gin_action_item = TRUE πŸ› Cannot opt out buttons using #gin_action_item = TRUE Active patch is also necessary for the Gin theme, which is pending integration.

  • Status changed to RTBC 8 days ago
  • πŸ‡―πŸ‡΅Japan ultrabob Japan

    @joseminosa, I'm sorry for the very slow reply. Are you reporting that the other issue is important, or are you reporting a new issue besides the one in that other issue?

  • πŸ‡ΊπŸ‡ΈUnited States daletrexel Minnesota, USA

    I'm setting this back to "Needs work" since the patch from MR15 doesn't apply to the latest -dev release.

    In the process of testing the -dev upgrade on Drupal 10, I encountered the assertion problem mentioned by @ultrabob in this issue, so this is not specifically a Drupal 11 problem. I've proposed breaking that out to a separate issue to help simplify this one focused on Drupal 11 compatibility only. See πŸ› Assertion for entity.form_builder service is incorrect Active .

    As far as I can tell, from the latest -dev release, the only changes needed to make this module (and submodule) D11-ready is to add ^11 to each of the .info.yaml files, as in the original automated updates in #4 πŸ“Œ Automated Drupal 11 compatibility fixes for workflow_buttons Active . Upgrade Status module scans report no other issues if you make these changes.

  • First commit to issue fork.
  • πŸ‡ΊπŸ‡ΈUnited States mark_fullmer Tucson

    I've updated the MR to be mergeable into the latest changes in 8.x-1.x. Setting back to 'Needs review' -- based on the previous comment, this should be able to be set to RTBC forthwith.

  • Pipeline finished with Success
    7 days ago
    Total: 148s
    #458849
  • πŸ‡―πŸ‡΅Japan ultrabob Japan

    Thanks @mark_fullmer I looked at the commit and confirmed there is nothing there to be alarmed about. Back to RTBC

  • πŸ‡ΊπŸ‡ΈUnited States daletrexel Minnesota, USA

    There is something wrong with this issue fork. The patch in MR!15 may apply to 8.x-1.x in this issue fork, but it does not apply against the 8.x-1.0-beta6 release, nor does it apply against the latest 8.x-1.x of the actual project.

    First of all, this fork's 8.x-1.x branch should be rebased against the project 8.x-1.x, as it is currently at the beta6 tag. I tried to do so, but don't have push access.

    Second, there is something odd with this "project-update-bot-only" branch which prevents the MR!15 patch to be applied outside this fork. Attempting to apply the MR!15 patch to either the beta6 tag or the most recent 8.x-1.x of the module results in the following rejection to be generated. a.k.a workflow_buttons.module.rej:

    @@ -105,7 +105,7 @@
           'workflow_buttons' => TRUE,
         ];
         $form_builder = \Drupal::service('entity.form_builder');
    -    assert($form_builder instanceof FormBuilder);
    +    assert($form_builder instanceof EntityFormBuilderInterface);
         try {
           $form = $form_builder->getForm($entity, 'default', $form_state_additions);
         }

    I've tried to figure out how this discrepancy crept in, and so far have not figured things out. Basically, assert($form_builder instanceof FormBuilder); doesn't exist in either (beta6 or the module's latest 8.x-1.x), so the patch fails to find the line to remove.

    Hopefully someone more familiar with this module's history can figure it out. As it is, someone trying to get their implementation of this module ready for Drupal 11 is going to have a hard time.

  • Merge request !19Replay Drupal 11 compatibility β†’ (Open) created by mark_fullmer
  • πŸ‡ΊπŸ‡ΈUnited States mark_fullmer Tucson

    Basically, assert($form_builder instanceof FormBuilder); doesn't exist in either (beta6 or the module's latest 8.x-1.x), so the patch fails to find the line to remove.

    It exists here: https://git.drupalcode.org/project/workflow_buttons/-/blob/8.x-1.x/workf...

    It is not in the 1.0-beta6 release, since that tag occurs prior to the two commits that introduced, and then modified that code:

    Introduced: https://git.drupalcode.org/project/workflow_buttons/-/commit/a3badee0e30...
    Modified: https://git.drupalcode.org/project/workflow_buttons/-/commit/f4d5631ddc6...

    So we are not going to have a single patch that applies both to the 8.x-1.x branch and 8.x-1.0beta6.

    I've created a new branch / merge request, confirmed it has all the commits present in the 8.x-1.x branch, and replayed the relevant D11-compatibility changes, omitting code syntax cleanup since that should be considered out of scope for D11 compatibility solely.

  • πŸ‡ΊπŸ‡ΈUnited States mark_fullmer Tucson

    mark_fullmer β†’ changed the visibility of the branch project-update-bot-only to hidden.

  • Pipeline finished with Failed
    about 9 hours ago
    Total: 204s
    #463743
Production build 0.71.5 2024