Deprecated function : .../LayoutLoad.php

Created on 1 September 2023, about 1 year ago
Updated 24 October 2023, about 1 year ago

After installing the theme on D10 project I got a lot of deprecated function who are related to the LayoutLoad.php.
Screenshot in attachment.

Anyone a solutions.

For this project I have
Drupal 10.1.1
Php 8.2.9

🐛 Bug report
Status

Needs review

Version

5.1

Component

Module Support

Created by

🇧🇪Belgium Mav_fly

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @Mav_fly
  • Assigned to shubham_jain
  • @shubham_jain opened merge request.
  • Issue was unassigned.
  • Status changed to Needs review about 1 year ago
  • 🇮🇳India shubham_jain

    Hi, raised PR to solve the issue please verify.

  • 🇧🇪Belgium Mav_fly

    @shubham_jain What do you exactly by raising the PR ?

    I add in the /adaptivetheme/at_core/src/Layout/LayoutLoad.php the following :

    /**
    * To solve the dynamic property issue.
    */
    protected $layout_config;

    What I could find here

    Thanks in advance
    Kristof

  • 🇮🇳India shubham_jain
    /**
    * To solve the dynamic property issue.
    */
    protected $layout_config;

    @Mav_fly, as the comment suggests this is to solve the Deprecated function because the function is deprecated but the variable is the main reason behind it.

    To solve this issue, you can do two things. First which I have done second is add following code instead of first one.

    #[\AllowDynamicProperties]
    class LayoutLoad extends Layout {
    

    You can use whatever you seems fit.

  • I can confirm your PR looks to solve the issue, however, by testing I discovered 2 more deprecations when saving the extension settings:

    Creation of dynamic property Drupal\at_core\Layout\Layout::$layout_path is deprecated in Drupal\at_core\Layout\Layout->__construct() (line 27 of /at_core/src/Layout/Layout.php)
    Creation of dynamic property Drupal\at_core\Layout\Layout::$layout_cid is deprecated in Drupal\at_core\Layout\Layout->__construct() (line 28 of /at_core/src/Layout/Layout.php)
Production build 0.71.5 2024