Automated Drupal 11 compatibility fixes for file_browser

Created on 30 May 2024, about 1 year 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 about 1 year 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 d.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
    8 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 d.fisher
  • Status changed to Needs work 7 months ago
  • Pipeline finished with Failed
    7 months ago
    Total: 258s
    #415686
  • Pipeline finished with Failed
    7 months ago
    Total: 206s
    #415713
  • Pipeline finished with Failed
    7 months ago
    Total: 161s
    #415753
  • Pipeline finished with Failed
    7 months ago
    Total: 165s
    #415763
  • Pipeline finished with Failed
    7 months ago
    Total: 172s
    #415776
  • Pipeline finished with Failed
    7 months ago
    Total: 193s
    #415780
  • Pipeline finished with Failed
    7 months ago
    Total: 168s
    #415793
  • Pipeline finished with Failed
    7 months ago
    Total: 164s
    #415803
  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom d.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 d.fisher

    I'll give it a go!!

  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom d.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
    7 months ago
    Total: 3431s
    #415998
  • Pipeline finished with Canceled
    7 months ago
    Total: 329s
    #416031
  • Pipeline finished with Failed
    7 months 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
    7 months ago
    Total: 166s
    #416060
  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom d.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
    7 months ago
    Total: 151s
    #416091
  • Pipeline finished with Failed
    7 months 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 d.fisher

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

  • Pipeline finished with Failed
    7 months ago
    Total: 183s
    #416176
  • Pipeline finished with Failed
    7 months ago
    Total: 164s
    #416188
  • Pipeline finished with Failed
    7 months ago
    #416202
  • Pipeline finished with Failed
    7 months ago
    Total: 165s
    #416208
  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom d.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
    7 months ago
    Total: 2694s
    #416610
  • Pipeline finished with Failed
    7 months ago
    Total: 175s
    #416673
  • Pipeline finished with Failed
    7 months ago
    Total: 167s
    #416695
  • Pipeline finished with Failed
    7 months ago
    Total: 170s
    #416738
  • Pipeline finished with Failed
    7 months ago
    Total: 160s
    #416742
  • Pipeline finished with Failed
    7 months ago
    Total: 164s
    #416744
  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom d.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
    6 months ago
    Total: 210s
    #420748
  • Pipeline finished with Failed
    6 months ago
    Total: 160s
    #420766
  • Pipeline finished with Failed
    6 months ago
    Total: 234s
    #420779
  • Pipeline finished with Failed
    6 months ago
    Total: 156s
    #420785
  • Pipeline finished with Failed
    6 months ago
    #420796
  • Pipeline finished with Failed
    6 months ago
    #420797
  • Pipeline finished with Failed
    6 months ago
    #420801
  • Pipeline finished with Failed
    6 months ago
    #420802
  • Pipeline finished with Failed
    6 months ago
    Total: 179s
    #420806
  • Pipeline finished with Failed
    6 months ago
    Total: 180s
    #420845
  • Pipeline finished with Failed
    6 months ago
    Total: 199s
    #420868
  • Pipeline finished with Failed
    6 months ago
    Total: 164s
    #420874
  • Pipeline finished with Failed
    6 months ago
    Total: 249s
    #420893
  • Pipeline finished with Failed
    6 months ago
    Total: 162s
    #420914
  • Pipeline finished with Failed
    6 months ago
    Total: 240s
    #420916
  • Pipeline finished with Failed
    6 months ago
    Total: 174s
    #420934
  • Pipeline finished with Failed
    6 months ago
    Total: 162s
    #420944
  • Pipeline finished with Failed
    6 months ago
    Total: 170s
    #420969
  • Pipeline finished with Failed
    6 months ago
    Total: 266s
    #420992
  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom d.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
    6 months ago
    Total: 156s
    #421064
  • Pipeline finished with Failed
    6 months ago
    Total: 159s
    #421083
  • Pipeline finished with Failed
    6 months ago
    Total: 156s
    #421098
  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom daniel.j

    daniel.j โ†’ made their first commit to this issueโ€™s fork.

  • Pipeline finished with Failed
    6 months ago
    Total: 159s
    #422184
  • Pipeline finished with Failed
    6 months ago
    Total: 168s
    #422202
  • Pipeline finished with Failed
    6 months ago
    Total: 173s
    #422234
  • Pipeline finished with Success
    6 months ago
    Total: 156s
    #423069
  • Pipeline finished with Success
    6 months 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 d.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 d.fisher

    Any news? Desperate for a D11 release!!!

  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom d.fisher

    Is the module maintainer still active?

  • Status changed to RTBC 4 months ago
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States caspervoogt

    @darren.fisher, I checked out the maintainer's site (https://mortenson.coffee/) and FYI it says "I did Drupal for a long time, but am trying my hand at security engineering now." (not sure that implies he stopped doing Drupal recently?) I checked his drupal.org profile and his last credited contribution was March 31st. Not that long ago.

    I changed the status to "Reviewed & tested by the community" in the hope that gets this issue the attention it deserves, plus with two people reporting this patch is fine, this feels appropriate.

  • ๐Ÿ‡ณ๐Ÿ‡ฟNew Zealand ericgsmith

    I would suggest opening an issue to take over the maintenance of the project โ†’ if somebody has capacity for this.

    As noted in his bio:

    I am retiring a bit from Drupal.org, so unless one of my projects is actually broken I will probably not be checking on the issue queues. Thanks!

    More context for this is also available here - https://www.thedroptimes.com/interview/48921/drupal-core-static-site-inn...

  • When can we expect this issue to be fixed into a proper release?

  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom d.fisher

    I'm going to apply for maintainership just to get this one out of the door.

  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom d.fisher

    Issue opened. Let's see what happens:
    https://www.drupal.org/project/file_browser/issues/3535186 ๐Ÿ“Œ Offering to co-maintain File Browser Active

  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom rivimey

    It would indeed be good to get this released for D11.

    In passing, I note that the core version is now v8..v11, which seems highly unlikely to be correct given all the removed interfaces over the versions. IMO we should either test on v8[latest] and v9[latest], or change that to ^10 || ^11 or similar.

  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom d.fisher

    Agreed. I think it would make sense to provide a new major release supporting >=10.3.

  • Pipeline finished with Failed
    25 days ago
    Total: 149s
    #559830
  • Pipeline finished with Failed
    24 days ago
    Total: 146s
    #560454
  • Pipeline finished with Failed
    24 days ago
    Total: 150s
    #560463
  • Pipeline finished with Failed
    24 days ago
    Total: 152s
    #560469
  • Pipeline finished with Failed
    24 days ago
    Total: 146s
    #560471
  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom d.fisher

    I've targeted ^10 || ^11 but the tests are now failing on an unrelated issue!

  • Pipeline finished with Failed
    23 days ago
    Total: 293s
    #561515
  • Pipeline finished with Failed
    23 days ago
    #561608
  • Pipeline finished with Failed
    23 days ago
    #561615
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia rajas samse

    rajas samse โ†’ made their first commit to this issueโ€™s fork.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia rajas samse

    Hello,

    I have updated the README.txt file to align with modern standards and workflows for Drupal 11.
    The changes are available on the "my-doc-updates" branch in the issue fork for review.
    Could a contributor for MR !6 (like @d.fisher or @daniel.j) please merge this branch into the main 3451080-automated-drupal-11 branch?

    Thank you!

  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom d.fisher

    Hey Rajas. Changes look good on first glance. I've opened a merge request:
    https://git.drupalcode.org/issue/file_browser-3451080/-/merge_requests/1/

    Daniel and I will review and merge if we can (we should have permission to do so). Then we aim to fix the tests which seem to have broken again and hopefully by that time I will have become a maintainer and we can roll this out to a stable release.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States MilanT

    Hey Darren... it looks like they want you to confirm that you want to be a co-maintainer on the project over at: drupal.org/project/file_browser/issues/3535186

    Standard procedure I guess.. but thought I'd give you a heads up.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States rcisneros

    Seconding #41, Darren they are waiting for you to comment back to confirm your interest in being the maintainer for this project. https://www.drupal.org/project/projectownership/issues/3535186#comment-16229930 ๐Ÿ“Œ Offering to co-maintain File Browser Active

Production build 0.71.5 2024