Automated Drupal 10 compatibility fixes

Created on 16 June 2022, over 2 years ago
Updated 18 January 2024, 10 months 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

Fixed

Version

2.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.

  • First commit to issue fork.
  • @henokmikre opened merge request.
  • πŸ‡ΉπŸ‡­Thailand Nick Hope

    I'm preparing a site for upgrading from D9.5.11 to D10.2.

    When I try to apply this with composer I get a No valid composer.json was found... error.

    The other D10-compatibility MR at https://www.drupal.org/project/media_taxonomy_filter/issues/3406755 πŸ“Œ Automated Drupal 10 compatibility fixes with composer file Needs review will apply with Composer, because it includes a composer.json file, but it gives me Page Not Found, with no error messages, on pages using this module.

    That other MR uses $plugins['entity:taxonomy_term']['class'] = 'Drupal\taxonomy\Plugin\views\argument_validator\TermName'; in media_taxonomy_filter.views.inc, whereas the one in #5 here uses $plugins['entity:taxonomy_term']['class'] = 'Drupal\views\Plugin\views\argument_validator\Entity';.

    I don't have the experience to know which of ...\argument_validator\TermName or ...\argument_validator\Entity is correct or preferable in this case.

  • πŸ‡ΊπŸ‡ΈUnited States henokmikre

    @Nick, according to https://www.drupal.org/node/3221870 β†’ , the correct validator is \Drupal\views\Plugin\views\argument_validator\Entity, so this patch should work for you. Here is one way to get this working: first ensure your composer.json is valid before adding this patch. Then add the following to the top of your "repositories" line:

            {
                "type": "package",
                "package": {
                    "name": "drupal/media_taxonomy_filter",
                    "version": "dev-8.x-2.x",
                    "type": "drupal-module",
                    "source": {
                        "type": "git",
                        "url": "https://git.drupalcode.org/project/media_taxonomy_filter.git",
                        "reference": "b0352483691533d69605b35e17491336fea4b2f1"
                    }
                }
            },
    

    Then add this in the "require" section: "drupal/media_taxonomy_filter": "dev-8.x-2.x",. You should then be able to run composer install.

    • 065a7afb committed on 1.0.x
      Issue #3288527, #3406755 by rakesh.nimje84@gmail.com, henokmikre,...
  • Status changed to Fixed 11 months ago
  • Hello, i just made a drupal 10 release.
    you can install it with:
    composer require 'drupal/media_taxonomy_filter:^3.0@beta'

    Thank you guys for your help.

  • πŸ‡ΉπŸ‡­Thailand Nick Hope

    @henokmikre Thank you for that. That installed the dev version but I would still need a patch on top of that. Anyway it doesn't matter because of the new release from olivier.br.

    @olivier.br Thank you very much. It works for me. Unfortunately media_taxonomy_filter.info.yml is missing the info that is normally added by the Drupal.org packaging script:

    version: '3.0.0-beta1'
    project: 'media_taxonomy_filter'
    datestamp: some number

    So the module does not appear on /admin/reports/updates and there is no version number on /admin/modules etc..

    I can raise a separate issue if you prefer.

  • @Nick, thank you
    I will check how to get that later this day.

  • πŸ‡ΉπŸ‡­Thailand Nick Hope

    @olivier.br I've only ever done this once or twice but think it's to do with creating a release tag: https://www.drupal.org/docs/develop/git/git-for-drupal-project-maintaine... β†’

  • @Nick, that's exactly what i did to publish a new release.

    After a try on my side to install the module on a new project with composer, i do have the packaging data included in the info.yml file:

    # Information added by Drupal.org packaging script on 2024-01-04
    version: '3.0.0-beta1'
    project: 'media_taxonomy_filter'
    datestamp: 1704356226

    Maybe try to completely remove the module and to install it again ?

  • πŸ‡ΉπŸ‡­Thailand Nick Hope

    @olivier.br Thank you. I did remove it and require it again with Composer and this time the info.yml file has the packaging data and the module appears on /admin/modules. It still doesn't appear on /admin/reports/updates, despite drush cr. I'm not sure why that would be. It's not the first time I've seen that happen. Does it appear on /admin/reports/updates for anyone else?

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024