Closed ghost closed 7 years ago
The $list is not initialized to array. So if there are no singles to get then a warning is popped.
-- Added $list = [];
/** * Get all single content types. * @return array|mixed */ public function getAllSingles() { $list = &drupal_static(__FUNCTION__); if (!isset($list)) { $list = []; /** @var NodeTypeInterface $type */ foreach (NodeType::loadMultiple() as $type) { if ($this->isSingle($type)) { $list[$type->get('type')] = $type; } } } return $list; }
❤️
Thx! @RobinHoutevelts will follow up :)
The $list is not initialized to array. So if there are no singles to get then a warning is popped.
-- Added $list = [];