Wrong handle with null values on getRemoteStatus

Created on 28 January 2023, almost 2 years ago
Updated 15 February 2023, almost 2 years ago

Problem/Motivation

Wrong handle for null values on getRemoteStatus. When the widget in registry.json doesn't have the `status` field, the module set it to null.
The problem is that the Interface forces to return a string.

TypeError: Drupal\widget_type\Entity\WidgetType::getRemoteStatus(): Return value must be of type string, null returned in Drupal\widget_type\Entity\WidgetType->getRemoteStatus() (line 336 of /var/www/html/web/modules/contrib/widget_type/src/Entity/WidgetType.php)

Steps to reproduce

- Ingest widgets without status field
- Visit the widget instance page and try to add a new widget
- There is a WSOD

Proposed resolution

Change the interface to return a nullable string for getReturnStatus.

Remaining tasks

Return nullable string.

User interface changes

N/A

API changes

N/A

Data model changes

N/A

🐛 Bug report
Status

Fixed

Version

1.5

Component

Code

Created by

🇪🇸Spain isholgueras

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

Comments & Activities

Production build 0.71.5 2024