$this->getPortlets()->getValue() ignores typed data defintions in field item definition

Created on 3 April 2024, 16 days ago


This code here: https://git.drupalcode.org/project/homebox/-/blob/3.0.x/src/Entity/Homeb...
($this->get('portlets')->getValue();) doesn't return the typed field item values. 'portlets' is initialised as a BaseField definition here. And the "homebox_portlet" FieldItem is defined here. We have defined the "propertyDefinitions()" method with the correct data definitions and created the schema.yml, but the output of $this->get('portlets')->getValue(); will return all the properties casted to string ("layoutRegionWeight" and "enabled" shouldn't be string by definition):

Config inspector won't throw any errors. This bug makes the whole code quite error-prone, as we are using data types everywhere else in the code.

Steps to reproduce

Proposed resolution

Find the issue and fix it.

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report






Created by

🇩🇪Germany Grevil

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

Comments & Activities

Production build https://api.contrib.social 0.62.1