Skip to content
Snippets Groups Projects
Commit 7c624767 authored by Andrei Mateescu's avatar Andrei Mateescu
Browse files

Issue #3478060 by plov: The first #1 argument ($array) must be of type array,...

Issue #3478060 by plov: The first #1 argument ($array) must be of type array, null given in array_slice() in user_bundle.install file
parent f282400c
No related branches found
No related tags found
No related merge requests found
......@@ -46,7 +46,7 @@ function user_bundle_install() {
$base = $module_handler->getModule('user_bundle')->getPath() . '/install';
// Add "Type" field to view, as the third field.
$config = $view->get('display.default.display_options.fields');
$config = $view->get('display.default.display_options.fields') ?: [];
$config = array_slice($config, 0, 2, TRUE) +
['type' => Yaml::parse(file_get_contents("$base/display.default.display_options.fields.type.yml"))] +
array_slice($config, 2, count($config) - 1, TRUE);
......@@ -57,7 +57,7 @@ function user_bundle_install() {
$view->set('display.default.display_options.style.options.info.type', Yaml::parse(file_get_contents("$base/display.default.display_options.style.options.info.type.yml")));
// Add "Type" exposed filter, as the second filter.
$config = $view->get('display.default.display_options.filters');
$config = $view->get('display.default.display_options.filters') ?: [];
$config = array_slice($config, 0, 1, TRUE) +
['type' => Yaml::parse(file_get_contents("$base/display.default.display_options.filters.type.yml"))] +
array_slice($config, 1, count($config) - 1, TRUE);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment