Automated Drupal 11 compatibility fixes for file_browser

Created on 30 May 2024, 9 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
  • Status changed to Needs review 9 months ago
  • 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
  • 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-188138

    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
  • πŸ‡¬πŸ‡§United Kingdom darren.fisher

    This looks ok to me.

  • First commit to issue fork.
  • Merge request !5Drupal 11 compatibility β†’ (Open) created by Unnamed author
  • First commit to issue fork.
  • Pipeline finished with Failed
    3 months ago
    Total: 171s
    #365881
  • heddn Nicaragua

    Needs work because tests are failing. This depends upon πŸ“Œ Automated Drupal 11 compatibility fixes for embed Needs review & πŸ“Œ Automated Drupal 11 compatibility fixes for entity_embed Needs review landing first.

  • Merge request !6Drupal 11 Compatibility β†’ (Open) created by darren.fisher
  • Status changed to Needs work 29 days ago
  • Pipeline finished with Failed
    29 days ago
    Total: 258s
    #415686
  • Pipeline finished with Failed
    29 days ago
    Total: 206s
    #415713
  • Pipeline finished with Failed
    29 days ago
    Total: 161s
    #415753
  • Pipeline finished with Failed
    29 days ago
    Total: 165s
    #415763
  • Pipeline finished with Failed
    29 days ago
    Total: 172s
    #415776
  • Pipeline finished with Failed
    29 days ago
    Total: 193s
    #415780
  • Pipeline finished with Failed
    29 days ago
    Total: 168s
    #415793
  • Pipeline finished with Failed
    29 days ago
    Total: 164s
    #415803
  • πŸ‡¬πŸ‡§United Kingdom darren.fisher

    I've managed to resolve most of the tests failing but I cannot resolve this one:
    https://git.drupalcode.org/issue/file_browser-3451080/-/jobs/4255146

    1) Drupal\Tests\file_browser\FunctionalJavascript\FileBrowserTest::testFileBrowserView
    ReferenceError: Dropzone is not defined
        at Object.attach (http://localhost/web/modules/contrib/dropzonejs/js/dropzone.integration.js?v=11.1.1:16:7)
        at http://localhost/web/core/misc/drupal.js?v=11.1.1:166:24
        at Array.forEach (<anonymous>)
        at Drupal.attachBehaviors (http://localhost/web/core/misc/drupal.js?v=11.1.1:162:34)
        at http://localhost/web/core/misc/drupal.init.js?v=11.1.1:32:12
        at HTMLDocument.listener (http://localhost/web/core/misc/drupal.init.js?v=11.1.1:20:7)
    TypeError: Cannot read properties of undefined (reading 'element')
        at http://localhost/web/modules/contrib/dropzonejs/modules/eb_widget/js/dropzonejs_eb_widget.common.js?v=11.1.1:15:39
        at Array.forEach (<anonymous>)
        at Object.attach (http://localhost/web/modules/contrib/dropzonejs/modules/eb_widget/js/dropzonejs_eb_widget.common.js?v=11.1.1:14:60)
        at http://localhost/web/core/misc/drupal.js?v=11.1.1:166:24
        at Array.forEach (<anonymous>)
        at Drupal.attachBehaviors (http://localhost/web/core/misc/drupal.js?v=11.1.1:162:34)
        at http://localhost/web/core/misc/drupal.init.js?v=11.1.1:32:12
        at HTMLDocument.listener (http://localhost/web/core/misc/drupal.init.js?v=11.1.1:20:7)
    TypeError: $view.imagesLoaded is not a function
        at Object.attach (http://localhost/web/modules/custom/file_browser-3451080/js/file_browser.view.js?v=11.1.1:58:15)
        at http://localhost/web/core/misc/drupal.js?v=11.1.1:166:24
        at Array.forEach (<anonymous>)
        at Drupal.attachBehaviors (http://localhost/web/core/misc/drupal.js?v=11.1.1:162:34)
        at http://localhost/web/core/misc/drupal.init.js?v=11.1.1:32:12
        at HTMLDocument.listener (http://localhost/web/core/misc/drupal.init.js?v=11.1.1:20:7)
    /builds/issue/file_browser-3451080/web/core/tests/Drupal/FunctionalJavascriptTests/WebDriverTestBase.php:140

    Not sure how the Dropzone or imagesLoaded javascript gets loaded within the runner? Bit beyond me but if anyone else with better knowledge of it can crack that one this should be good for testing again?

  • heddn Nicaragua

    Dropzone has a js library that doesn't natively get pulled in. My guess we have to add a before_script section to gitlab-ci to trigger download of the js library into the correct location.

  • πŸ‡¬πŸ‡§United Kingdom darren.fisher

    I'll give it a go!!

  • πŸ‡¬πŸ‡§United Kingdom darren.fisher

    Does it count if the pipeline freezes and doesn't pass or fail? Jk. Not sure if I've done this right or not:
    https://git.drupalcode.org/issue/file_browser-3451080/-/pipelines/415998

  • Pipeline finished with Canceled
    29 days ago
    Total: 3431s
    #415998
  • Pipeline finished with Canceled
    29 days ago
    Total: 329s
    #416031
  • Pipeline finished with Failed
    29 days ago
    Total: 234s
    #416040
  • heddn Nicaragua

    From https://git.drupalcode.org/issue/file_browser-3451080/-/jobs/4258213, we should address the undefined calls to libraries_get_path

    And that might be why tests are failing in https://git.drupalcode.org/issue/file_browser-3451080/-/jobs/4258217. Maybe.

  • Pipeline finished with Failed
    29 days ago
    Total: 166s
    #416060
  • πŸ‡¬πŸ‡§United Kingdom darren.fisher

    Fixed those but still failing. It's not happy about this Dropzone library. Does dropzonejs need to be added as a library maybe in file_browser.libraries.yml? There's a dropzone css library entry but nothing for the js?

  • Pipeline finished with Failed
    29 days ago
    Total: 151s
    #416091
  • Pipeline finished with Failed
    29 days ago
    Total: 163s
    #416094
  • heddn Nicaragua

    I think we are now at valid test failures. The library got downloaded fine at this point. I ended up copying from gitlab-ci on dropzone.

  • πŸ‡¬πŸ‡§United Kingdom darren.fisher

    So is the issue now that we need to do the same for imagesLoaded?

  • Pipeline finished with Failed
    29 days ago
    Total: 183s
    #416176
  • Pipeline finished with Failed
    29 days ago
    Total: 164s
    #416188
  • Pipeline finished with Failed
    29 days ago
    #416202
  • Pipeline finished with Failed
    29 days ago
    Total: 165s
    #416208
  • πŸ‡¬πŸ‡§United Kingdom darren.fisher

    Ok progressed this further but hit a wall again. Masonry is not a function. I've tried pulling in masonry from two different sources in the gitlab-ci but it's still failing.

  • Pipeline finished with Failed
    28 days ago
    Total: 2694s
    #416610
  • Pipeline finished with Failed
    28 days ago
    Total: 175s
    #416673
  • Pipeline finished with Failed
    28 days ago
    Total: 167s
    #416695
  • Pipeline finished with Failed
    28 days ago
    Total: 170s
    #416738
  • Pipeline finished with Failed
    28 days ago
    Total: 160s
    #416742
  • Pipeline finished with Failed
    28 days ago
    Total: 164s
    #416744
  • πŸ‡¬πŸ‡§United Kingdom darren.fisher

    I can't get through this failure:

    There was 1 failure:
    1) Drupal\Tests\file_browser\FunctionalJavascript\FileBrowserTest::testFileBrowserView
    Behat\Mink\Exception\ElementNotFoundException: Button with id|name|title|alt|value "Use selected" not found.

    Does anyone with better knowledge of these tests know why it wouldn't be able to find the Use selected submit input? I've manually tested the steps in the test and everything looks correct to me. I'm a bit lost now. I've managed to resolve all of the JS library loading failures but this one is beyond me!

  • Pipeline finished with Failed
    23 days ago
    Total: 210s
    #420748
  • Pipeline finished with Failed
    23 days ago
    Total: 160s
    #420766
  • Pipeline finished with Failed
    23 days ago
    Total: 234s
    #420779
  • Pipeline finished with Failed
    23 days ago
    Total: 156s
    #420785
  • Pipeline finished with Failed
    23 days ago
    #420796
  • Pipeline finished with Failed
    23 days ago
    #420797
  • Pipeline finished with Failed
    23 days ago
    #420801
  • Pipeline finished with Failed
    23 days ago
    #420802
  • Pipeline finished with Failed
    23 days ago
    Total: 179s
    #420806
  • Pipeline finished with Failed
    23 days ago
    Total: 180s
    #420845
  • Pipeline finished with Failed
    23 days ago
    Total: 199s
    #420868
  • Pipeline finished with Failed
    23 days ago
    Total: 164s
    #420874
  • Pipeline finished with Failed
    23 days ago
    Total: 249s
    #420893
  • Pipeline finished with Failed
    23 days ago
    Total: 162s
    #420914
  • Pipeline finished with Failed
    23 days ago
    Total: 240s
    #420916
  • Pipeline finished with Failed
    23 days ago
    Total: 174s
    #420934
  • Pipeline finished with Failed
    23 days ago
    Total: 162s
    #420944
  • Pipeline finished with Failed
    23 days ago
    Total: 170s
    #420969
  • Pipeline finished with Failed
    23 days ago
    Total: 266s
    #420992
  • πŸ‡¬πŸ‡§United Kingdom darren.fisher

    These tests are failing due to Button with id|name|title|alt|value "Use selected" not found. I have tried various attempts to resolve this and am at my wits end with it. I suspect it may be to do with the use of the iframe or something which has changed in entity_browser itself. Feel free to take a look.

  • Pipeline finished with Failed
    23 days ago
    Total: 156s
    #421064
  • Pipeline finished with Failed
    23 days ago
    Total: 159s
    #421083
  • Pipeline finished with Failed
    23 days ago
    Total: 156s
    #421098
  • πŸ‡¬πŸ‡§United Kingdom daniel.j

    daniel.j β†’ made their first commit to this issue’s fork.

  • Pipeline finished with Failed
    22 days ago
    Total: 159s
    #422184
  • Pipeline finished with Failed
    22 days ago
    Total: 168s
    #422202
  • Pipeline finished with Failed
    22 days ago
    Total: 173s
    #422234
  • Pipeline finished with Success
    21 days ago
    Total: 156s
    #423069
  • Pipeline finished with Success
    21 days ago
    Total: 155s
    #423077
  • πŸ‡¬πŸ‡§United Kingdom daniel.j

    I've made some changes and tests are now passing.

    For the phpunit functional JS tests, in some places moving away from jQuery to native JS has allowed the tests to pass. Additionally, I've added a `composer.libaraies.json` file in order to add clarity to the library versions that are being used.

    Please review, thanks.

  • πŸ‡¬πŸ‡§United Kingdom darren.fisher

    This is looking good now. Can people please test so we can get this module a stable Drupal 11 release?

  • πŸ‡¬πŸ‡§United Kingdom daniel.j

    daniel.j β†’ changed the visibility of the branch 3451080-d11_ready to hidden.

  • πŸ‡¬πŸ‡§United Kingdom darren.fisher

    Any news? Desperate for a D11 release!!!

  • πŸ‡¬πŸ‡§United Kingdom darren.fisher

    Is the module maintainer still active?

Production build 0.71.5 2024