TimeZoneItem::generateSampleValue() returns a string instead of an array

Created on 5 September 2021, over 3 years ago
Updated 14 February 2023, almost 2 years ago

Problem/Motivation

FieldItemBase::generateSampleValue()
is documented to return an array. And every core class that overrides this method *does* return an array, except for TimeZoneItem::generateSampleValue(), which returns a string.

$ drupal-check -a core/modules/user/src/TimeZoneItem.php 
 1/1 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%

 ------ ---------------------------------------------------------------------- 
  Line   TimeZoneItem.php                                                      
 ------ ---------------------------------------------------------------------- 
  21     Method Drupal\user\TimeZoneItem::generateSampleValue() should return  
         array but returns string.                                             
 ------ ---------------------------------------------------------------------- 


 [ERROR] Found 1 error  

Proposed resolution

Fix TimeZoneItem::generateSampleValue() so that it returns the correct datatype.

User interface changes

None.

API changes

None.

Data model changes

None.

🐛 Bug report
Status

Needs work

Version

10.1

Component
Field 

Last updated 3 days ago

Created by

🇺🇸United States tr Cascadia

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024