By les lim on
Change record status:
Published (View all published change records)
Project:
Introduced in branch:
8.x
Introduced in version:
8.0-ALPHA7
Issue links:
Description:
This is a followup to element_* functions deprecated; use Element class methods instead.
The procedural Drupal 7 function element_properties() was replaced in Drupal 8 by \Drupal\Core\Render\Element::properties(). Previously, element_properties() technically would accept a non-array parameter, which would automatically be cast into an array. The analogous Element::properties() method only accepts arrays.
Before:
$thing = new stdClass;
$thing->{'#title'} = 'Foo';
$thing_properties = element_properties($thing);
After:
$thing = new stdClass;
$thing->{'#title'} = 'Foo';
$thing_properties = \Drupal\Core\Render\Element::properties( (array) $thing );
Impacts:
Module developers