Automated Drupal 10 compatibility fixes

Created on 16 June 2022, over 2 years ago
Updated 5 September 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

Fixed

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.

  • We're using this module and recently upgraded our core from D9 to D10. We've installed this patch. This module currently fails for us on D10. When attempting to create or edit any node with this module enabled, we are presented with the following exception error, I will document this as a separate bug ticket as well

    The website encountered an unexpected error. Please try again later.

    InvalidArgumentException: Expected a scalar value as a 2nd argument to "Symfony\Component\HttpFoundation\InputBag::get()", "array" given. in Symfony\Component\HttpFoundation\InputBag->get() (line 31 of /opt/drupal/web/vendor/symfony/http-foundation/InputBag.php).
    Drupal\require_on_publish\Plugin\Validation\Constraint\RequireOnPublishValidator->validate(Object, Object) (Line: 202)
    Drupal\Core\TypedData\Validation\RecursiveContextualValidator->validateConstraints(Object, '0000000000000c940000000000000000', Array) (Line: 154)
    Drupal\Core\TypedData\Validation\RecursiveContextualValidator->validateNode(Object, Array, 1) (Line: 106)
    Drupal\Core\TypedData\Validation\RecursiveContextualValidator->validate(Object, NULL, NULL) (Line: 93)
    Drupal\Core\TypedData\Validation\RecursiveValidator->validate(Object) (Line: 132)
    Drupal\Core\TypedData\TypedData->validate() (Line: 489)
    Drupal\Core\Entity\ContentEntityBase->validate() (Line: 248)
    Drupal\Core\Entity\Entity\EntityFormDisplay->validateFormValues(Object, Array, Object) (Line: 2322)
    Drupal\paragraphs\Plugin\Field\FieldWidget\ParagraphsWidget->massageFormValues(Array, Array, Object) (Line: 395)
    Drupal\Core\Field\WidgetBase->extractFormValues(Object, Array, Object) (Line: 2382)
    Drupal\paragraphs\Plugin\Field\FieldWidget\ParagraphsWidget->extractFormValues(Object, Array, Object) (Line: 237)
    Drupal\Core\Entity\Entity\EntityFormDisplay->extractFormValues(Object, Array, Object) (Line: 334)
    Drupal\Core\Entity\ContentEntityForm->copyFormValuesToEntity(Object, Array, Object) (Line: 293)
    Drupal\Core\Entity\EntityForm->buildEntity(Array, Object) (Line: 155)
    Drupal\Core\Entity\ContentEntityForm->buildEntity(Array, Object) (Line: 186)
    Drupal\Core\Entity\ContentEntityForm->validateForm(Array, Object)
    call_user_func_array(Array, Array) (Line: 82)
    Drupal\Core\Form\FormValidator->executeValidateHandlers(Array, Object) (Line: 275)
    Drupal\Core\Form\FormValidator->doValidateForm(Array, Object, 'node_result_form') (Line: 118)
    Drupal\Core\Form\FormValidator->validateForm('node_result_form', Array, Object) (Line: 591)
    Drupal\Core\Form\FormBuilder->processForm('node_result_form', Array, Object) (Line: 323)
    Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 73)
    Drupal\Core\Controller\FormController->getContentResult(Object, Object) (Line: 39)
    Drupal\layout_builder\Controller\LayoutBuilderHtmlEntityFormController->getContentResult(Object, Object)
    call_user_func_array(Array, Array) (Line: 123)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 580)
    Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 163)
    Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 74)
    Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
    Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
    Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
    Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
    Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
    Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
    Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 51)
    Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 686)
    Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

  • I believe I've resolved the issue. Created a patch below and attached a inter diff text file for review.

  • Status changed to RTBC over 1 year ago
  • 🇺🇸United States moshe weitzman Boston, MA
  • 🇫🇮Finland zHelmet

    Had problems with this patch, i got error saying Symfony\Component\HttpKernel\Exception\BadRequestHttpException: Input value "status" contains a non-scalar value. in Symfony\Component\HttpKernel\HttpKernel->handle(). Found out that we need to use all instead of get from request object.

  • First commit to issue fork.
  • 🇺🇸United States moshe weitzman Boston, MA

    LGTM. How about we merge and make a D10 compatible release?

  • Open in Jenkins → Open on Drupal.org →
    Core: 10.0.7 + Environment: PHP 7.4 & MySQL 8
    last update over 1 year ago
    Composer require failure
  • Open in Jenkins → Open on Drupal.org →
    Core: 10.0.7 + Environment: PHP 8.1 & MySQL 8
    last update over 1 year ago
    Composer require failure
  • Assigned to bakop
  • Status changed to Active over 1 year ago
  • 🇫🇷France bakop Lille

    Hi, the patch is not applicable on my side, there is an error on composer.
    I'm working on new version of this patch.

  • @bakop opened merge request.
  • Issue was unassigned.
  • Status changed to Needs review over 1 year ago
  • 🇫🇷France bakop Lille

    Patch sent as MR (MR !6).

  • @bakop opened merge request.
  • Status changed to Active over 1 year ago
  • 🇫🇷France bakop Lille
  • Status changed to Needs review over 1 year ago
  • 🇫🇷France bakop Lille
  • Status changed to RTBC over 1 year ago
  • Patch applies and looks good.

    Marking as RTBC so we can get a D10 compatible release soon 🤞

  • Status changed to Fixed about 1 year ago
  • 🇺🇸United States mpriscella New York, NY
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024