Problem/Motivation

Panels module is not compatible with php 8.4 and throwing warning on drush cr.

Steps to reproduce

2 Warnings :

  1. PHP Deprecated: Drupal\panels\Form\PanelsAddBlockForm::buildForm(): Implicitly marking parameter $request as nullable is deprecated, the explicit nullable type must be used instead in /var/www/docroot/modules/contrib/panels/src/Form/PanelsAddBlockForm.php on line 65
  2. Deprecated: Drupal\panels\Form\PanelsAddBlockForm::buildForm(): Implicitly marking parameter $request as nullable is deprecated, the explicit nullable type must be used instead in /var/www/docroot/modules/contrib/panels/src/Form/PanelsAddBlockForm.php on line 65

    Proposed resolution

Remaining tasks

Fix php code and make it compatible

User interface changes

NONE

API changes

NONE

Data model changes

NONE

CommentFileSizeAuthor
#3 panels_php84_fix.patch799 bytesnehajyoti

Issue fork panels-3534531

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

nehajyoti created an issue. See original summary.

nehajyoti’s picture

Issue summary: View changes
nehajyoti’s picture

StatusFileSize
new799 bytes

https://git.drupalcode.org/issue/panels-3534531/-/merge_requests/new?mer...

Unable to create MR. Link mentioned above.

Hence attaching the patch

joelpittet’s picture

Version: 8.x-4.9 » 8.x-4.x-dev
Status: Active » Needs review

joelpittet’s picture

Assigned: nehajyoti » Unassigned
Status: Needs review » Reviewed & tested by the community

Barring any merge issues, this should be fixed—thanks @nehajyoti! Also you almost had the MR working, just needed to create it, the commit was there and everything.

As a side note, I’d recommend moving to Layout Builder instead of Panels if you have the opportunity.

  • joelpittet committed 55700b96 on 8.x-4.x
    Issue #3534531 by nehajyoti, joelpittet: php 8.4 compatibility issue
    
joelpittet’s picture

Status: Reviewed & tested by the community » Fixed
joelpittet’s picture

Status: Fixed » Closed (fixed)

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

rajab natshah’s picture

Thank you for the fix in this issue.
Hoping for a release.

jaswinsingh’s picture

Tested MR 32 on PHP 8.4.17, there are still some warnings reported by phpcs

FILE: /panels/panels_ipe/src/Form/PanelsIPELayoutForm.php
97 | WARNING | Implicitly marking a parameter as nullable is deprecated since PHP 8.4. Update the type to be explicitly nullable instead. Found implicitly nullable parameter: $panels_display.

FILE: /panels/panels_ipe/src/Form/PanelsIPEBlockPluginForm.php
111 | WARNING | Implicitly marking a parameter as nullable is deprecated since PHP 8.4. Update the type to be explicitly nullable instead. Found implicitly nullable parameter: $panels_display.

joseph.olstad’s picture

@joelpitted, 7 or 8 months without a tagged release, we're now chasing our tails.

By simply tagging 8.x-4.10 we could have avoided the duplicate issue mentioned here:
#3577740: PHP 8.4 deprecation: implicitly nullable parameters in Panels cause deprecation notices