Automated Drupal 11 compatibility fixes for markdown

Created on 4 April 2024, 10 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

3.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
  • Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 8.0 & MySQL 5.7
    last update 10 months ago
    Waiting for branch to pass
  • 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-137198

    These packages were used to generate the fixes:

    1. drupal/upgrade_status: 4.1.0
    2. mglaman/phpstan-drupal: 1.2.10
    3. palantirnet/drupal-rector: 0.20.1
  • Status changed to Needs review 10 months ago
  • Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 8.0 & MySQL 5.7
    last update 10 months ago
    Waiting for branch to pass
  • 🇨🇭Switzerland scito

    We are in the Drupal 7 to Drupal 11 migration. Not having a Drupal 11 Release of the Markdown module is blocking for us. If it is not fixed in the meantime, I'll have a look at this issue.

  • 🇦🇺Australia interlated

    Note - I use Markdown to include module documentation, not with the text editor.

    * web/modules/patched/markdown/src/Annotation/ComposerPackage.php 34 Call to deprecated method getInstalledVersion() of class Drupal\markdown\Util\Composer. Deprecated in markdown:8.x-2.0 and is removed from markdown:4.0.0. No replacement.

    Marked as deprecated. Delete now?

    * web/modules/patched/markdown/src/Annotation/ComposerPackage.php 34 Call to deprecated method getVersionFromClass() of class Drupal\markdown\Util\Composer. Deprecated in markdown:8.x-2.0 and is removed from markdown:4.0.0. No replacement.

    As above

    * web/modules/patched/markdown/src/BcSupport/SubformState.php 16 Class Drupal\markdown\BcSupport\SubformState extends deprecated class Drupal\markdown\BcSupport\FormStateDecoratorBase. Deprecated in markdown:8.x-2.0 and is removed from markdown:3.0.0. Use Drupal\Core\Form\FormStateDecoratorBase instead.

    Delete now

    Delete the whole BCSupport package

    I can't see the referenced @todo Move upstream to https://www.drupal.org/project/installable_plugins . Something here https://www.drupal.org/docs/drupal-apis/plugin-api ?

    I can't see any references to "InstallablePlugin" outside of markdown. Is this a custom concept for markdown to manage the parsers?

    This refactoring does fall apart here.

    * web/modules/patched/markdown/src/Exception/MarkdownFileNotExistsException.php 11 Class Drupal\markdown\Exception\MarkdownFileNotExistsException extends deprecated class Drupal\markdown\Exception\MarkdownException. Deprecated in markdown:8.x-2.0 and is removed from markdown:3.0.0. Use Drupal\markdown\Exception\MarkdownExceptionInterface instead.

    Refactor now.

    PluginBase
    PluginInterface

  • 🇦🇺Australia interlated

    What is a similar module? 'Crop'?

  • 🇦🇺Australia interlated

    Breaks in drush

    PHP Fatal error: Trait "Symfony\Component\DependencyInjection\ContainerAwareTrait" not found in /Users/jrobens/Sites/gardensofstone2/web/modules/patched/markdown/src/PluginManager/InstallablePluginManager.php on line 32

    Means this module isn't usable for me.

    The best shot I can find to implement plugins is from 'feeds tamper'. I can take a shot at implementing this if it helps

    use Drupal\Component\Plugin\PluginManagerInterface;
    use Drupal\Core\Plugin\DefaultLazyPluginCollection;

    ContainerAwareTrait has been deprecated
    https://www.drupal.org/project/drupal/issues/3431362 📌 [PP-2] Remove support for ContainerAwareInterface Postponed

    Sometimes, a service needs access to several other services without being sure that all of them will actually be used. In those cases, you may want the instantiation of the services to be lazy. However, that's not possible using the explicit dependency injection since services are not all meant to be lazy.

    CacheFactory, CacheTagsInvalidator, CheckProvider, StreamWrapperManager, KernelDestructionSubscriber all look like they could use this technique.

    EntityTypeManager and ClassResolver are more tricky and need access to the entire container, but I think we could just inject the container as a service in these cases.

  • First commit to issue fork.
  • 🇮🇳India suryabhi

    suryabhi changed the visibility of the branch project-update-bot-only to hidden.

  • 🇦🇺Australia interlated

    PHP 8.4 warnings from latest git pull

    PHP Deprecated: Drupal\layout_paragraphs\Access\LayoutParagraphsBuilderAccess::access(): Implicitly marking parameter $operation as nullable is deprecated, the explicit nullable type must be used instead in /Users/jrobens/Sites/gardensofstone2/web/modules/contrib/layout_paragraphs/src/Access/LayoutParagraphsBuilderAccess.php on line 52
    PHP Deprecated: Drupal\layout_paragraphs\Access\LayoutParagraphsBuilderAccess::access(): Implicitly marking parameter $component_uuid as nullable is deprecated, the explicit nullable type must be used instead in /Users/jrobens/Sites/gardensofstone2/web/modules/contrib/layout_paragraphs/src/Access/LayoutParagraphsBuilderAccess.php on line 52
    PHP Deprecated: Drupal\layout_paragraphs\Access\LayoutParagraphsBuilderAccess::access(): Implicitly marking parameter $paragraph_type as nullable is deprecated, the explicit nullable type must be used instead in /Users/jrobens/Sites/gardensofstone2/web/modules/contrib/layout_paragraphs/src/Access/LayoutParagraphsBuilderAccess.php on line 52
    PHP Deprecated: Drupal\xmlsitemap\XmlSitemapStorage::__construct(): Implicitly marking parameter $memory_cache as nullable is deprecated, the explicit nullable type must be used instead in /Users/jrobens/Sites/gardensofstone2/web/modules/contrib/xmlsitemap/src/XmlSitemapStorage.php on line 43
    PHP Deprecated: Drupal\xmlsitemap\XmlSitemapStorage::doLoadMultiple(): Implicitly marking parameter $ids as nullable is deprecated, the explicit nullable type must be used instead in /Users/jrobens/Sites/gardensofstone2/web/modules/contrib/xmlsitemap/src/XmlSitemapStorage.php on line 78
    PHP Deprecated: Drupal\xmlsitemap\Entity\XmlSitemap::loadByContext(): Implicitly marking parameter $context as nullable is deprecated, the explicit nullable type must be used instead in /Users/jrobens/Sites/gardensofstone2/web/modules/contrib/xmlsitemap/src/Entity/XmlSitemap.php on line 200
    PHP Deprecated: Drupal\xmlsitemap\XmlSitemapInterface::loadByContext(): Implicitly marking parameter $context as nullable is deprecated, the explicit nullable type must be used instead in /Users/jrobens/Sites/gardensofstone2/web/modules/contrib/xmlsitemap/src/XmlSitemapInterface.php on line 147
    PHP Deprecated: auto_detect_line_endings is deprecated in /Users/jrobens/Sites/gardensofstone2/web/sites/default/civicrm.settings.php on line 573
    PHP Deprecated: Log::log(): Implicitly marking parameter $priority as nullable is deprecated, the explicit nullable type must be used instead in /Users/jrobens/Sites/gardensofstone2/vendor/pear/log/Log.php on line 240
    PHP Deprecated: Smarty::getTemplateVars(): Implicitly marking parameter $_ptr as nullable is deprecated, the explicit nullable type must be used instead in /Users/jrobens/Sites/gardensofstone2/vendor/civicrm/civicrm-packages/Smarty/Smarty.class.php on line 1086
    PHP Deprecated: Drupal\civicrm\Form\UserProfile::buildForm(): Implicitly marking parameter $user as nullable is deprecated, the explicit nullable type must be used instead in /Users/jrobens/Sites/gardensofstone2/web/modules/contrib/civicrm/src/Form/UserProfile.php on line 71
    PHP Deprecated: Drupal\context_ui\Form\ConditionDeleteForm::buildForm(): Implicitly marking parameter $context as nullable is deprecated, the explicit nullable type must be used instead in /Users/jrobens/Sites/gardensofstone2/web/modules/patched/context/modules/context_ui/src/Form/ConditionDeleteForm.php on line 92
    PHP Deprecated: Drupal\context_ui\Form\ReactionDeleteForm::buildForm(): Implicitly marking parameter $context as nullable is deprecated, the explicit nullable type must be used instead in /Users/jrobens/Sites/gardensofstone2/web/modules/patched/context/modules/context_ui/src/Form/ReactionDeleteForm.php on line 95
    PHP Deprecated: Drupal\context\Reaction\Blocks\Form\BlockDeleteForm::buildForm(): Implicitly marking parameter $context as nullable is deprecated, the explicit nullable type must be used instead in /Users/jrobens/Sites/gardensofstone2/web/modules/patched/context/src/Reaction/Blocks/Form/BlockDeleteForm.php on line 95
    PHP Deprecated: Drupal\context\Reaction\Blocks\Form\BlockFormBase::buildForm(): Implicitly marking parameter $context as nullable is deprecated, the explicit nullable type must be used instead in /Users/jrobens/Sites/gardensofstone2/web/modules/patched/context/src/Reaction/Blocks/Form/BlockFormBase.php on line 206
    PHP Deprecated: Drupal\fontawesome\Form\EditorIconDialog::buildForm(): Implicitly marking parameter $editor as nullable is deprecated, the explicit nullable type must be used instead in /Users/jrobens/Sites/gardensofstone2/web/modules/patched/fontawesome/src/Form/EditorIconDialog.php on line 71
    PHP Deprecated: Drupal\layout_paragraphs\Form\EditComponentForm::buildForm(): Implicitly marking parameter $layout_paragraphs_layout as nullable is deprecated, the explicit nullable type must be used instead in /Users/jrobens/Sites/gardensofstone2/web/modules/contrib/layout_paragraphs/src/Form/EditComponentForm.php on line 21
    PHP Deprecated: Drupal\layout_paragraphs\Form\EditComponentForm::buildForm(): Implicitly marking parameter $component_uuid as nullable is deprecated, the explicit nullable type must be used instead in /Users/jrobens/Sites/gardensofstone2/web/modules/contrib/layout_paragraphs/src/Form/EditComponentForm.php on line 21
    PHP Deprecated: Drupal\layout_paragraphs\Form\DeleteComponentForm::buildForm(): Implicitly marking parameter $layout_paragraphs_layout as nullable is deprecated, the explicit nullable type must be used instead in /Users/jrobens/Sites/gardensofstone2/web/modules/contrib/layout_paragraphs/src/Form/DeleteComponentForm.php on line 63
    PHP Deprecated: Drupal\layout_paragraphs\Form\DeleteComponentForm::buildForm(): Implicitly marking parameter $component_uuid as nullable is deprecated, the explicit nullable type must be used instead in /Users/jrobens/Sites/gardensofstone2/web/modules/contrib/layout_paragraphs/src/Form/DeleteComponentForm.php on line 63
    PHP Deprecated: Drupal\media_bulk_upload\Form\MediaBulkUploadForm::buildForm(): Implicitly marking parameter $media_bulk_config as nullable is deprecated, the explicit nullable type must be used instead in /Users/jrobens/Sites/gardensofstone2/web/modules/patched/media_bulk_upload/src/Form/MediaBulkUploadForm.php on line 176
    PHP Deprecated: Drupal\photos\Form\PhotosUploadForm::buildForm(): Implicitly marking parameter $node as nullable is deprecated, the explicit nullable type must be used instead in /Users/jrobens/Sites/gardensofstone2/web/modules/patched/photos/src/Form/PhotosUploadForm.php on line 184
    PHP Deprecated: Drupal\photos\Controller\PhotosRearrangeController::access(): Implicitly marking parameter $account as nullable is deprecated, the explicit nullable type must be used instead in /Users/jrobens/Sites/gardensofstone2/web/modules/patched/photos/src/Controller/PhotosRearrangeController.php on line 125
    PHP Deprecated: Drupal\photos\Controller\PhotosRearrangeController::access(): Implicitly marking parameter $node as nullable is deprecated, the explicit nullable type must be used instead in /Users/jrobens/Sites/gardensofstone2/web/modules/patched/photos/src/Controller/PhotosRearrangeController.php on line 125
    PHP Deprecated: Drupal\photos\Controller\PhotosRearrangeController::access(): Implicitly marking parameter $user as nullable is deprecated, the explicit nullable type must be used instead in /Users/jrobens/Sites/gardensofstone2/web/modules/patched/photos/src/Controller/PhotosRearrangeController.php on line 125
    PHP Deprecated: Drupal\tfa\Form\TfaOverviewForm::buildForm(): Implicitly marking parameter $user as nullable is deprecated, the explicit nullable type must be used instead in /Users/jrobens/Sites/gardensofstone2/web/modules/contrib/tfa/src/Form/TfaOverviewForm.php on line 108
    PHP Deprecated: Drupal\tfa\Form\TfaSetupForm::buildForm(): Implicitly marking parameter $user as nullable is deprecated, the explicit nullable type must be used instead in /Users/jrobens/Sites/gardensofstone2/web/modules/contrib/tfa/src/Form/TfaSetupForm.php on line 163
    PHP Deprecated: Drupal\tfa\Form\TfaDisableForm::buildForm(): Implicitly marking parameter $user as nullable is deprecated, the explicit nullable type must be used instead in /Users/jrobens/Sites/gardensofstone2/web/modules/contrib/tfa/src/Form/TfaDisableForm.php on line 95
    PHP Deprecated: Drupal\ds\Form\FieldDeleteForm::buildForm(): Implicitly marking parameter $request as nullable is deprecated, the explicit nullable type must be used instead in /Users/jrobens/Sites/gardensofstone2/web/modules/contrib/ds/src/Form/FieldDeleteForm.php on line 77
    PHP Deprecated: Drupal\photos\Controller\PhotosImageViewController::__construct(): Implicitly marking parameter $entity_repository as nullable is deprecated, the explicit nullable type must be used instead in /Users/jrobens/Sites/gardensofstone2/web/modules/patched/photos/src/Controller/PhotosImageViewController.php on line 72
    [success] Cache rebuild complete.

  • First commit to issue fork.
  • 🇮🇳India suryabhi

    current output of drush us-a markdown:

    Markdown,  3.0.1
    Scanned on Wed, 8 Jan 2025 - 08:33
    
    FILE: modules/contrib/markdown/src/PluginManager/InstallablePluginManager.php
    
    STATUS         LINE                           MESSAGE
    --------------------------------------------------------------------------------
    Check manually 478  Call to deprecated method convertInstalledToLibraries() of
                        class
                        Drupal\markdown\PluginManager\InstallablePluginManager.
                        Deprecated in markdown:8.x-2.0 and is removed from
                        markdown:3.0.0. There is no replacement.
    --------------------------------------------------------------------------------
Production build 0.71.5 2024