Fix OpenAPI with PHP 8.2+ of Deprecated function: Creation of dynamic property

Created on 4 January 2024, 12 months ago
Updated 16 April 2024, 8 months ago

Problem/Motivation

 Deprecated function: Creation of dynamic property Drupal\openapi\Controller\OpenApiListController::$openapiUiManager is deprecated in Drupal\openapi\Controller\OpenApiListController->__construct() (line 32 of modules/contrib/openapi/src/Controller/OpenApiListController.php).
Drupal\openapi\Controller\OpenApiListController->__construct(Object, Object) (Line: 44)
Drupal\openapi\Controller\OpenApiListController::create(Object) (Line: 28)
Drupal\Core\DependencyInjection\ClassResolver->getInstanceFromDefinition('\Drupal\openapi\Controller\OpenApiListController') (Line: 100)
Drupal\Core\Utility\CallableResolver->getCallableFromDefinition('\Drupal\openapi\Controller\OpenApiListController::downloadsList') (Line: 50)
Drupal\Core\Controller\ControllerResolver->getControllerFromDefinition('\Drupal\openapi\Controller\OpenApiListController::downloadsList', '/admin/config/services/openapi') (Line: 65)
Drupal\Core\Controller\ControllerResolver->getController(Object) (Line: 164)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 54)
Drupal\simple_oauth\HttpMiddleware\BasicAuthSwap->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: 36)
Drupal\Core\StackMiddleware\AjaxPageState->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 704)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

Proposed resolution

  • Change drupal/openapi to 2.1.0 in the composer.json file.
  • Add a local patch for OpenAPI issue 📌 PHP 8.2 Deprecations RTBC
          "drupal/openapi": {
            "Issue #3412276: Fix OpenAPI with PHP 8.2+ of Deprecated function: Creation of dynamic property":
            "https://www.drupal.org/files/issues/2024-01-04/openapi--3362322-9--2023-05-26--mr10--bd284519.patch"
          }
        

Remaining tasks

  • ✅ File an issue about this project
  • ✅ Addition/Change/Update/Fix to this project
  • ✅ Testing to ensure no regression
  • ➖ Automated unit/functional testing coverage
  • ➖ Developer Documentation support on feature change/addition
  • ➖ User Guide Documentation support on feature change/addition
  • ➖ UX/UI designer responsibilities
  • ➖ Accessibility and Readability
  • ✅ Code review from 1 Varbase core team member
  • ✅ Full testing and approval
  • ✅ Credit contributors
  • ✅ Review with the product owner
  • ✅ Update Release Notes and Update Helper on new feature change/addition
  • ✅ Release varbase-10.0.0-rc2 , varbase-9.0.18 , varbase_api-9.0.14 , Varbase 9.1.1 , varbase_api-9.1.2 , varbase_api-10.0.3

Varbase update type

  • ✅ No Update
  • ➖ Optional Update
  • ➖ Forced Update
  • ➖ Forced Update if Unchanged

User interface changes

  • N/A

API changes

  • N/A

Data model changes

  • N/A

Release notes snippet

  • Issue #3412276 : Fixed OpenAPI with PHP 8.2+ of Deprecated function: Creation of dynamic property
📌 Task
Status

Fixed

Version

10.0

Component

Code

Created by

🇯🇴Jordan Rajab Natshah Jordan

Live updates comments and jobs are added and updated live.
  • PHP 8.2

    The issue particularly affects sites running on PHP version 8.2.0 or later.

Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024