Problem/Motivation

When new config split is created, warning is thrown. Problem is that array_walk executes callback with two parameters and strtolower is used as callback, where we have function that expects one parameter.

Proposed resolution

Possible solution is to wrap strtolower into callback function with two parameters expected.
Or simply change array_walk with foreach.

Warning Log

Warning: strtolower() expects exactly 1 parameter, 2 given in Drupal\config_split\Form\ConfigSplitEntityForm->filterConfigNames() (line 226 of modules/config_split/src/Form/ConfigSplitEntityForm.php).
Drupal\config_split\Form\ConfigSplitEntityForm->filterConfigNames(Array) (Line: 203)
Drupal\config_split\Form\ConfigSplitEntityForm->submitForm(Array, Object)
call_user_func_array(Array, Array) (Line: 111)
Drupal\Core\Form\FormSubmitter->executeSubmitHandlers(Array, Object) (Line: 51)
Drupal\Core\Form\FormSubmitter->doSubmitForm(Array, Object) (Line: 589)
Drupal\Core\Form\FormBuilder->processForm('config_split_add_form', Array, Object) (Line: 318)
Drupal\Core\Form\FormBuilder->buildForm('config_split_add_form', Object) (Line: 93)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 582)
CommentFileSizeAuthor
#2 2983564_2.patch598 bytesmtodor

Comments

mtodor created an issue. See original summary.

mtodor’s picture

StatusFileSize
new598 bytes

Here is a solution with foreach.

mtodor’s picture

Status: Active » Needs review

  • bircher committed 45c8829 on 8.x-1.x
    Issue #2983564 by mtodor: Warning on strtolower in ConfigSplitEntityForm
    
bircher’s picture

Status: Needs review » Fixed

Thanks for the contribution!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.