Automated Drupal 10 compatibility fixes.

Created on 23 July 2022, over 2 years ago
Updated 3 November 2023, about 1 year ago

Problem/Motivation

Hello project maintainers,

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

To read more about this effort by the Drupal Association, please read: The project update bot is being refreshed to support Drupal 10 readiness of contributed projects β†’

Patches will periodically be added to this issue that remove Drupal 10 deprecated API uses. To stop further patches 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 "ProjectUpdateBotD10" tag from the issue to stop the bot from posting updates.

The patches 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 patches 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 "ProjectUpdateBotD10" tag is left on this issue, new patches 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 patches 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 patches. The bot will still post new patches then if there is a change in the new generated patch compared to the patch that the bot posted last. Those changes are then up to humans to integrate.

  2. Leave open but stop new automated patches.

    If you want to use this issue as a starting point to remove deprecated API uses but then don't want new automated patches, remove the "ProjectUpdateBotD10" tag from the issue and use it like any other issue (the status does not matter then). If you want to receive automated patches again, add back the "ProjectUpdateBotD10" 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 patches will be posted here.

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

    If you are using another issue(s) to work on Drupal 10 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.

Providing feedback

If there are problems with one of the patches 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

Needs review

Version

1.0

Component

Code

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States kthull Fort Wayne, Indiana

    Patch #6 applies and upgrade status only reports a problem for D11, so this looks good.

  • First commit to issue fork.
  • πŸ‡³πŸ‡±Netherlands Wishal.f

    Fixed deprecation warnings/errors.

  • Status changed to RTBC over 1 year ago
  • πŸ‡³πŸ‡±Netherlands gidarai

    I have reviewed patch #9. Seems to solve all of the errors/warnings in Drupal 10. Let's move this to RTBC

  • πŸ‡«πŸ‡·France Fabsgugu

    Hello,

    Would it be possible to resolve the issue quickly? The end of life of Drupal 9 is near.

  • πŸ‡ͺπŸ‡ΈSpain purushotam.rai

    Can you please create merge request https://git.drupalcode.org/issue/unmanaged_files-3299384/-/compare/1.0.x...
    Seems like I don't have access to create PR / MR

  • πŸ‡ΊπŸ‡ΈUnited States alfattal Minnesota

    @purushotam.rai You're the module/project maintainer and you should have access to the Git repo!

  • Status changed to Needs review over 1 year ago
  • πŸ‡ΊπŸ‡ΈUnited States alfattal Minnesota

    Patch in #9 failed to apply while the patch in #6 applied successfully with no errors in the Upgrade Status report.

    Full trace:

    - Applying patches for drupal/unmanaged_files
    https://www.drupal.org/files/issues/2023-05-03/3299384-9.patch β†’ (3299384-9: Automated Drupal 10 compatibility fixes)
    Downloading https://www.drupal.org/files/issues/2023-05-03/3299384-9.patch β†’
    patch '-p1' --no-backup-if-mismatch -d 'docroot/modules/contrib/unmanaged_files' < '/tmp/64d69f6d1f3ac.patch'
    Executing command (CWD): patch '-p1' --no-backup-if-mismatch -d 'docroot/modules/contrib/unmanaged_files' < '/tmp/64d69f6d1f3ac.patch'
    patching file src/Form/DeleteUnmanagedFilesForm.php

    patching file src/UnmanagedFilesManager.php

    Reversed (or previously applied) patch detected!
    Assume -R? [n]

    Apply anyway? [n]

    Skipping patch.

    2 out of 2 hunks ignored
    -- saving rejects to file src/UnmanagedFilesManager.php.rej

    patching file unmanaged_files.info.yml

    patch '-p0' --no-backup-if-mismatch -d 'docroot/modules/contrib/unmanaged_files' < '/tmp/64d69f6d1f3ac.patch'
    Executing command (CWD): patch '-p0' --no-backup-if-mismatch -d 'docroot/modules/contrib/unmanaged_files' < '/tmp/64d69f6d1f3ac.patch'
    can't find file to patch at input line 5

    Perhaps you used the wrong -p or --strip option?

    The text leading up to this was:
    --------------------------

    |diff --git a/src/Form/DeleteUnmanagedFilesForm.php b/src/Form/DeleteUnmanagedFilesForm.php
    |index 3b6968a..55494d3 100644
    |--- a/src/Form/DeleteUnmanagedFilesForm.php
    |+++ b/src/Form/DeleteUnmanagedFilesForm.php
    --------------------------

    File to patch:

    Skip this patch? [y]

    Skipping patch.

    4 out of 4 hunks ignored

    can't find file to patch at input line 48

    Perhaps you used the wrong -p or --strip option?

    The text leading up to this was:
    --------------------------

    |diff --git a/src/UnmanagedFilesManager.php b/src/UnmanagedFilesManager.php
    |index 43fd52a..437e2af 100644
    |--- a/src/UnmanagedFilesManager.php
    |+++ b/src/UnmanagedFilesManager.php
    --------------------------

    File to patch:

    Skip this patch? [y]

    Skipping patch.

    2 out of 2 hunks ignored

    can't find file to patch at input line 70

    Perhaps you used the wrong -p or --strip option?

    The text leading up to this was:
    --------------------------

    |diff --git a/unmanaged_files.info.yml b/unmanaged_files.info.yml
    |index 8eb8c32..4c77cc6 100644
    |--- a/unmanaged_files.info.yml
    |+++ b/unmanaged_files.info.yml
    --------------------------

    File to patch:

    Skip this patch? [y]

    Skipping patch.

    1 out of 1 hunk ignored

    patch '-p2' --no-backup-if-mismatch -d 'docroot/modules/contrib/unmanaged_files' < '/tmp/64d69f6d1f3ac.patch'
    Executing command (CWD): patch '-p2' --no-backup-if-mismatch -d 'docroot/modules/contrib/unmanaged_files' < '/tmp/64d69f6d1f3ac.patch'
    can't find file to patch at input line 5

    Perhaps you used the wrong -p or --strip option?

    The text leading up to this was:
    --------------------------

    |diff --git a/src/Form/DeleteUnmanagedFilesForm.php b/src/Form/DeleteUnmanagedFilesForm.php
    |index 3b6968a..55494d3 100644
    |--- a/src/Form/DeleteUnmanagedFilesForm.php
    |+++ b/src/Form/DeleteUnmanagedFilesForm.php
    --------------------------

    File to patch:

    Skip this patch? [y]

    Skipping patch.

    4 out of 4 hunks ignored

    can't find file to patch at input line 48

    Perhaps you used the wrong -p or --strip option?

    The text leading up to this was:
    --------------------------

    |diff --git a/src/UnmanagedFilesManager.php b/src/UnmanagedFilesManager.php
    |index 43fd52a..437e2af 100644
    |--- a/src/UnmanagedFilesManager.php
    |+++ b/src/UnmanagedFilesManager.php
    --------------------------

    File to patch:

    Skip this patch? [y]

    Skipping patch.

    2 out of 2 hunks ignored

    can't find file to patch at input line 70

    Perhaps you used the wrong -p or --strip option?

    The text leading up to this was:
    --------------------------

    |diff --git a/unmanaged_files.info.yml b/unmanaged_files.info.yml
    |index 8eb8c32..4c77cc6 100644
    |--- a/unmanaged_files.info.yml
    |+++ b/unmanaged_files.info.yml
    --------------------------

    File to patch:

    Skip this patch? [y]

    Skipping patch.

    1 out of 1 hunk ignored

    patch '-p4' --no-backup-if-mismatch -d 'docroot/modules/contrib/unmanaged_files' < '/tmp/64d69f6d1f3ac.patch'
    Executing command (CWD): patch '-p4' --no-backup-if-mismatch -d 'docroot/modules/contrib/unmanaged_files' < '/tmp/64d69f6d1f3ac.patch'
    can't find file to patch at input line 5

    Perhaps you used the wrong -p or --strip option?

    The text leading up to this was:
    --------------------------

    |diff --git a/src/Form/DeleteUnmanagedFilesForm.php b/src/Form/DeleteUnmanagedFilesForm.php
    |index 3b6968a..55494d3 100644
    |--- a/src/Form/DeleteUnmanagedFilesForm.php
    |+++ b/src/Form/DeleteUnmanagedFilesForm.php
    --------------------------

    File to patch:

    Skip this patch? [y]

    Skipping patch.

    4 out of 4 hunks ignored

    can't find file to patch at input line 48

    Perhaps you used the wrong -p or --strip option?

    The text leading up to this was:
    --------------------------

    |diff --git a/src/UnmanagedFilesManager.php b/src/UnmanagedFilesManager.php
    |index 43fd52a..437e2af 100644
    |--- a/src/UnmanagedFilesManager.php
    |+++ b/src/UnmanagedFilesManager.php
    --------------------------

    File to patch:

    Skip this patch? [y]

    Skipping patch.

    2 out of 2 hunks ignored

    can't find file to patch at input line 70

    Perhaps you used the wrong -p or --strip option?

    The text leading up to this was:
    --------------------------

    |diff --git a/unmanaged_files.info.yml b/unmanaged_files.info.yml
    |index 8eb8c32..4c77cc6 100644
    |--- a/unmanaged_files.info.yml
    |+++ b/unmanaged_files.info.yml
    --------------------------

    File to patch:

    Skip this patch? [y]

    Skipping patch.

    1 out of 1 hunk ignored

    Could not apply patch! Skipping. The error was: Cannot apply patch https://www.drupal.org/files/issues/2023-05-03/3299384-9.patch β†’
    Downloading https://packages.drupal.org/8/downloads
    [200] https://packages.drupal.org/8/downloads

    In Patches.php line 326:

    [Exception]
    Cannot apply patch 3299384-9: Automated Drupal 10 compatibility fixes ( https://www.drupal.org/files/issues/2023-05-03/3299384-9.patch β†’ )!

    Exception trace:
    at /home/ffattal/mndor/vendor/cweagans/composer-patches/src/Patches.php:326
    cweagans\Composer\Patches->postInstall() at n/a:n/a
    call_user_func() at phar:///usr/local/bin/composer/src/Composer/EventDispatcher/EventDispatcher.php:202
    Composer\EventDispatcher\EventDispatcher->doDispatch() at phar:///usr/local/bin/composer/src/Composer/EventDispatcher/EventDispatcher.php:144
    Composer\EventDispatcher\EventDispatcher->dispatchPackageEvent() at phar:///usr/local/bin/composer/src/Composer/Installer/InstallationManager.php:460
    Composer\Installer\InstallationManager->Composer\Installer\{closure}() at phar:///usr/local/bin/composer/src/Composer/Installer/InstallationManager.php:475
    Composer\Installer\InstallationManager->executeBatch() at phar:///usr/local/bin/composer/src/Composer/Installer/InstallationManager.php:390
    Composer\Installer\InstallationManager->downloadAndExecuteBatch() at phar:///usr/local/bin/composer/src/Composer/Installer/InstallationManager.php:282
    Composer\Installer\InstallationManager->execute() at phar:///usr/local/bin/composer/src/Composer/Installer.php:759
    Composer\Installer->doInstall() at phar:///usr/local/bin/composer/src/Composer/Installer.php:281
    Composer\Installer->run() at phar:///usr/local/bin/composer/src/Composer/Command/InstallCommand.php:137
    Composer\Command\InstallCommand->execute() at phar:///usr/local/bin/composer/vendor/symfony/console/Command/Command.php:298
    Symfony\Component\Console\Command\Command->run() at phar:///usr/local/bin/composer/vendor/symfony/console/Application.php:1015
    Symfony\Component\Console\Application->doRunCommand() at phar:///usr/local/bin/composer/vendor/symfony/console/Application.php:299
    Symfony\Component\Console\Application->doRun() at phar:///usr/local/bin/composer/src/Composer/Console/Application.php:334
    Composer\Console\Application->doRun() at phar:///usr/local/bin/composer/vendor/symfony/console/Application.php:171
    Symfony\Component\Console\Application->run() at phar:///usr/local/bin/composer/src/Composer/Console/Application.php:130
    Composer\Console\Application->run() at phar:///usr/local/bin/composer/bin/composer:88
    require() at /usr/local/bin/composer:29

  • Status changed to Needs work over 1 year ago
  • πŸ‡ΊπŸ‡ΈUnited States alfattal Minnesota

    It appeared that patch in #6 although apply and resolve the D10 compatibility issue in the Upgrade Status report, it breaks the module functionality with the following error:

    The website encountered an unexpected error. Please try again later.
    TypeError: Cannot assign Drupal\Core\File\FileUrlGenerator to property Drupal\unmanaged_files\Form\DeleteUnmanagedFilesForm::$fileUrlGenerator of type Drupal\unmanaged_files\Form\FileUrlGeneratorInterface in Drupal\unmanaged_files\Form\DeleteUnmanagedFilesForm::create() (line 66 of modules/contrib/unmanaged_files/src/Form/DeleteUnmanagedFilesForm.php).
    Drupal\unmanaged_files\Form\DeleteUnmanagedFilesForm::create() (Line: 28)
    Drupal\Core\DependencyInjection\ClassResolver->getInstanceFromDefinition() (Line: 48)
    Drupal\Core\Controller\HtmlFormController->getFormObject() (Line: 58)
    Drupal\Core\Controller\FormController->getContentResult()
    call_user_func_array() (Line: 123)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 580)
    Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 124)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext() (Line: 97)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 169)
    Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 81)
    Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 68)
    Drupal\simple_oauth\HttpMiddleware\BasicAuthSwap->handle() (Line: 58)
    Drupal\Core\StackMiddleware\Session->handle() (Line: 48)
    Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 106)
    Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 85)
    Drupal\page_cache\StackMiddleware\PageCache->handle() (Line: 50)
    Drupal\ban\BanMiddleware->handle() (Line: 270)
    Drupal\shield\ShieldMiddleware->bypass() (Line: 137)
    Drupal\shield\ShieldMiddleware->handle() (Line: 48)
    Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51)
    Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 23)
    Stack\StackedHttpKernel->handle() (Line: 718)
    Drupal\Core\DrupalKernel->handle() (Line: 19)
  • Status changed to Needs review about 1 year ago
  • πŸ‡¦πŸ‡ͺUnited Arab Emirates schlaukopf Dubai

    This is basically the changes on 9, but this time composer should be able to apply the changes.

  • πŸ‡ΊπŸ‡¦Ukraine HitchShock Ukraine
  • @hitchshock opened merge request.
  • πŸ‡¬πŸ‡§United Kingdom andy_w

    The mysql Connection now resides in its own module, so I've attached an amend to the patch.

Production build 0.71.5 2024