- Issue created by @project update bot
This is an automated patch generated using Upgrade Status and Drupal Rector. Please see the issue summary for more details. A merge request 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 โ , even with these changes, this module is not yet compatible with Drupal 11.
Currently Drupal Rector, version 0.20.1, cannot fix all Drupal 11 compatibility problems.
Therefore these changes did not update the
info.yml
file for Drupal 11 compatibility.Leaving this issue open, even after committing the current patch, will allow the Project Update Bot โ to post additional Drupal 11 compatibility fixes as they become available in Drupal Rector.
Debug info
Bot run #11-121090This patch was created using these packages:
- drupal/upgrade_status: 4.1.0
- mglaman/phpstan-drupal: 1.2.7
- palantirnet/drupal-rector: 0.20.1
This comment was forced and has ignored the check if a change was already posted. This is only done when we want to update the issue without waiting for changes to happen.
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 โ , even with these changes, this module is not yet compatible with Drupal 11.
Currently Drupal Rector, version 0.20.1, cannot fix all Drupal 11 compatibility problems.
Therefore, these changes did not update the
info.yml
file for Drupal 11 compatibility.The compatibility issues that Upgrade Status found after the Drupal Rector fixes were applied are attached to help you resolve them manually.
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-137198These packages were used to generate the fixes:
- drupal/upgrade_status: 4.1.0
- mglaman/phpstan-drupal: 1.2.10
- 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 โ , even with these changes, this module is not yet compatible with Drupal 11.
Currently Drupal Rector, version 0.20.2, cannot fix all Drupal 11 compatibility problems.
Therefore, these changes did not update the
info.yml
file for Drupal 11 compatibility.The compatibility issues that Upgrade Status found after the Drupal Rector fixes were applied are attached to help you resolve them manually.
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-188815These packages were used to generate the fixes:
- drupal/upgrade_status: 4.3.2
- mglaman/phpstan-drupal: 1.2.11
- palantirnet/drupal-rector: 0.20.2
- First commit to issue fork.
- Merge request !16Issue #3431856 by srjosh - Update and make ready for D11 โ (Open) created by srjosh
- ๐บ๐ธUnited States srjosh
Rector fixes were pretty sketchy; took a stab at manually fixing them.
- First commit to issue fork.
- First commit to issue fork.
- ๐ฎ๐ณIndia manishvaity
MR!17 Makes this module compatible with Drupal 11. Functionality is working as expected.
RTBC +1
- First commit to issue fork.
- ๐จ๐ฆCanada mparker17 UTC-4
There are, apparently, 3 branches, 3 merge requests, and 3 patches associated with this issue. Both !16 and !17 were updated recently when I wrote this comment. I code reviewed both branches.
!17:
- adds a valid-but-unconventional
core_version_requirement: '>=10.2'
, - adds a
.gitlab-ci.yml
(even though that wasn't part of the issue scope), src/Form/MediaBulkUploadForm.php
is missing a newline at the end of the file,MediaTypeManager::getTargetFieldMaxSize()
has a change that looks like:
-return !empty($targetFieldSettings['max_filesize']) ? $targetFieldSettings['max_filesize'] : (string) format_size(Environment::getUploadMaxSize()); +return !empty($targetFieldSettings['max_filesize']) ? $targetFieldSettings['max_filesize'] : (string) DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '10.2.0', fn() => ByteSizeMarkup::create(Environment::getUploadMaxSize()), fn() => format_size(Environment::getUploadMaxSize()));
... in this change, I like the use of
\Drupal\Component\Utility\DeprecationHelper
, but it was missing a fallback value that is present in !16 (i.e.:?? 0
, see below)
!16 is identical to !17, except for the following things:
- !16 has a more-conventional
core_version_requirement
- which notably didn't reflect the change inMediaTypeManager::getTargetFieldMaxSize()
below, - !16 does not add a
.gitlab-ci.yml
(in keeping with the issue scope), src/Form/MediaBulkUploadForm.php
has the newline at the end of the file,MediaTypeManager::getTargetFieldMaxSize()
has a change that looks like:
-return !empty($targetFieldSettings['max_filesize']) ? $targetFieldSettings['max_filesize'] : (string) format_size(Environment::getUploadMaxSize()); +return !empty($targetFieldSettings['max_filesize']) ? $targetFieldSettings['max_filesize'] : (string) ByteSizeMarkup::create(Environment::getUploadMaxSize() ?? 0);
... I like the fallback (
?? 0
), but it is missing the use of\Drupal\Component\Utility\DeprecationHelper
, which would drop support 10.2, as ByteSizeMarkup doesn't exist in 10.2.
My recommendation is that we...
- Hide all the files associated with the ticket to reduce confusion (I will do this)
- Close !13 and !16 (I will do this)
- Change the
core_version_requirement
in !17 to something likecore_version_requirement: ^10.2 || ^11
- Add the newline to the end of
src/Form/MediaBulkUploadForm.php
in !17 - Delete the
.gitlab-ci.yml
in !17 - Add the fallback (i.e.:
?? 0
) to theMediaTypeManager::getTargetFieldMaxSize()
return statement from !16.
... if someone who isn't me could take on the last 4 tasks, then I can test again, and re-mark this as RTBC if it all works... my client wants this module updated to D11 so I have been assigned some time to help out in the next month or so.
- adds a valid-but-unconventional
- ๐จ๐ฆCanada mparker17 UTC-4
mparker17 โ changed the visibility of the branch project-update-bot-only to hidden.
- ๐จ๐ฆCanada mparker17 UTC-4
mparker17 โ changed the visibility of the branch 3431856-automated-drupal-11 to hidden.
- ๐ฎ๐ณIndia shashi_shekhar_18oct
Change the core_version_requirement in !17 to something like core_version_requirement: ^10.2 || ^11 (made this change)
Add the newline to the end of src/Form/MediaBulkUploadForm.php in !17 (added the new line )
Delete the .gitlab-ci.yml in !17 (deleted the gitlab-ci.yml) - ๐จ๐ฆCanada mparker17 UTC-4
@shashi_shekhar_18oct, thank you very much!
Quick process note: as a general rule, you shouldn't mark your own changes as RTBC โ ("it works on my machine" is a clichรฉ because it happens to all of us, regardless of our experience-level!).
So I'm moving it back to "Needs review" for now... but I have time to code review now, test on my own site, and if everything works, mark it as RTBC!
Thanks again!
- ๐จ๐ฆCanada mparker17 UTC-4
Taking a look at the code in merge request !17, I found the following things that will need to be fixed:
- There's still an instance of the old
core_version_requirement: '>=10.2'
inmodules/dropzonejs/media_bulk_upload_dropzonejs.info.yml
... so I'm marking this as "Needs work".
Running manual tests, I couldn't get !17 to work on D11, so I'm marking this as "Needs work". I'm not yet sure if this is something that I'm doing wrong, or an actual problem with D11 compatibility. I'm going to test again on a different computer to see if my setup on this one is broken.
Here's what I did to test !17...
- Install ddev (I tested on version 1.24.1)
- Clone the module, issue fork, and branch:
git clone https://git.drupalcode.org/project/media_bulk_upload.git && cd media_bulk_upload
- clone the projectgit remote add media_bulk_upload-3431856 git@git.drupal.org:issue/media_bulk_upload-3431856.git && git fetch media_bulk_upload-3431856
- add a remote for the issue forkgit checkout -b '3431856-d11_ready' --track media_bulk_upload-3431856/'3431856-d11_ready'
- switch to the branch for merge request !17
- Set up a test site for the module with the ddev/ddev-drupal-contrib plugin:
ddev config --project-type=drupal --docroot=web --php-version=8.3 --corepack-enable --project-name=media-bulk-upload
- create a ddev project for testing the moduleddev add-on get ddev/ddev-drupal-contrib && ddev start && ddev poser && ddev symlink-project
- run the setup steps for the ddev/ddev-drupal-contrib addonmkdir -p web/libraries/dropzone && curl -L -o web/libraries/dropzone/dropzone.min.js https://unpkg.com/dropzone@5/dist/min/dropzone.min.js
- quickly download and install the latest 5.x version of dropzonejsmkdir -p temp-documents
- create a folder outside the webroot to hold the bulk-uploaded documents before the media entities are fully created- Go to https://media-bulk-upload.ddev.site/core/install.php in a browser. Confirm that I saw the Drupal 11.0.9 installer. Install the site with the "Standard" install profile.
- Go to
/admin/people/create
and create a user with the Content editor role. I gave mine the usernametest_editor
.
- Set up the module for testing:
- Go to
/admin/modules
and install media_bulk_upload and its dependencies - Go to
/admin/modules
and install dropzonejs and its dependencies - Go to
/admin/config/media/media-bulk-config/add
, and enter:- Label =
File
- Media types =
Document
- Form mode =
- None -
- Upload location =
../temp-documents
(I tried various other values for this, see below)
... then click
Save
. You see the status message "Created the File Media Bulk Config." - Label =
- Go to
/admin/people/permissions/module/media_bulk_upload
, grant the Content editor role the following permissions:- dropzonejs -> Dropzone upload files
- Help -> Use help pages
- Media Bulk Upload -> File : Use upload form
- Media Bulk Upload -> Configure Media Upload form
- Go to
- If you don't already have a bunch of files to bulk-upload for testing, you can generate 9 ".doc" files with the following command in sh or bash:
cd ~/Desktop && mkdir test_media_bulk_upload && cd test_media_bulk_upload && for planet in Mercury Venus Earth Mars Jupiter Saturn Uranus Neptune Pluto; do echo $planet > $planet.doc ; done
(if you use some other shell, your mileage may vary) -
Test the basic module functions in Drupal 11:
- Log out of the administrator account, and log in as the
test_editor
Content editor user created earlier. - Go to
/admin/help/media_bulk_upload
. Confirm that I can see a help page. - Go to
/admin/config/media/media-bulk-config
. Confirm that I can see a "Bulk upload media" configuration page. - Click Edit next to the File Media Bulk Config I created earlier. Confirm that I can see a "Edit File" form. Click "Save" without making any changes. Confirm that I can see the status message "Saved the File Media Bulk Config."
- Go to
/media/bulk-upload/file
. Confirm that I can see a "Multiple upload" form. - Try bulk-uploading some of the files I generated earlier.
- Expected behavior: the files were successfully uploaded
- Actual behavior: I got an error,
The file could not be uploaded because the destination "../temp-documents/" is invalid
- I tried various other things for Upload location in the configuration...
/var/www/html/temp-documents
,sites/default/files/temp-documents
, etc. These were reflected in the error message, suggesting they were properly saved; but I got the same error in each case.
- I tried various other things for Upload location in the configuration...
- Log out of the administrator account, and log in as the
- Make sure there are no errors being logged:
- Log out of the
test_editor
user created earlier; and log in as the administrator again - Go to
/admin/reports/dblog
to ensure our setup/testing did not result in any error messages related to this module.
- Log out of the
- There's still an instance of the old
- ๐จ๐ฆCanada mparker17 UTC-4
Okay... when I tried this a second time on a different computer, my test case of the basic module functions worked perfectly. As far as I'm concerned, this means the module is working correctly.
@shashi_shekhar_18oct, if I could trouble you to change the
core_version_requirement
line inmodules/dropzonejs/media_bulk_upload_dropzonejs.info.yml
fromcore_version_requirement: '>=10.2'
tocore_version_requirement: ^10.2 || ^11
as you did before, then I'll do one last code review/test, then mark this as RTBC.Thank you very much in advance!
- First commit to issue fork.
- ๐จ๐ฆCanada mparker17 UTC-4
@cb_govcms, good catch, thank you!
@nghua, thanks for fixing the issues raised by myself and @cb_govcms. (I don't have permission to mark the thread that @cb_govcms started as "resolved" however)
I've code-reviewed the updated merge-request, and I'm happy with it. I also re-ran my test case from earlier on a freshly-cloned copy of the merge request, and it works for me.
I'm going to mark this as Reviewed and Tested by the Community. Thanks everyone!
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 โ , even with these changes, this module is not yet compatible with Drupal 11.
Currently Drupal Rector, version 0.20.3, cannot fix all Drupal 11 compatibility problems.
Therefore, these changes did not update the
info.yml
file for Drupal 11 compatibility.The compatibility issues that Upgrade Status found after the Drupal Rector fixes were applied are attached to help you resolve them manually.
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-392907These packages were used to generate the fixes:
- drupal/upgrade_status: 4.3.6
- mglaman/phpstan-drupal: 1.3.2
- palantirnet/drupal-rector: 0.20.3
- ๐ง๐ชBelgium flyke
The MR applies and I can update my project from D10 to D11 using drupal lenient.
But when I try to use media_bulk_uploads, I get this error:
Call to a member function guessMimeType() on null
comming from this piece of code:
$show_alt = (boolean) $media_bulk_config->get('show_alt'); $alt_required = (boolean) $media_bulk_config->get('alt_required'); foreach ($uploaded_files as $uploaded_file) { $errors = []; // Validate file alt. $mime = $this->mimeTypeGuesser->guessMimeType($uploaded_file['path']);
The mimeTypeGuesser is never instantiated.
- ๐ฏ๐ดJordan Rajab Natshah Jordan
Hoping for a tag release soon to ease and speed up testing and updates in projects.
- Status changed to RTBC
9 days ago 9:31pm 13 February 2025 - ๐ซ๐ทFrance Fabsgugu
Hello,
I contacted a maintainer and was told it was on their todolist.
- ๐ฌ๐งUnited Kingdom darren.fisher
+1 for RTBC! A tagged release would be great please!