PHP Fatal error in Drupal 9.5.2

Created on 22 January 2023, almost 2 years ago

Problem/Motivation

Hi
There is an issue with the 4.0 version of the module. See the below error code.

[22-Jan-2023 13:10:11 Asia/Tehran] PHP Fatal error: Declaration of Drupal\calendar_systems\Element\CalendarSystemsDate::preRenderDate(array $element): array must be compatible with Drupal\Core\Render\Element\Date::preRenderDate($element) in /home/host/public_html/modules/calendar_systems/src/Element/CalendarSystemsDate.php on line 13

Steps to reproduce

1- Upgrade Drupal to 9.5.2
2- Upgrade Calendar Systems to 4.0 from 8.x
3- Browse the website
4- Blank page appears

Proposed resolution

Referred source function to review:


class CalendarSystemsDate extends Date {

  public static function preRenderDate($element) {
    $element = parent::preRenderDate($element);
    if ($element['#attributes']['type'] === 'date') {
      $element['#attributes']['type'] = 'text';
    }
    return $element;
  }

Thanks for the efforts.
Keep the good job

🐛 Bug report
Status

Fixed

Version

4.0

Component

Code

Created by

🇮🇷Iran tsotoodeh

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

Comments & Activities

Production build 0.71.5 2024