I think there is an issue with configuration overriding.
When I set a default configuration, the overriding applies to only first level in the array.
I want to add parameters to filebrowserImageBrowseRouteParameters but currently I need to redefine all keys of filebrowserImageBrowseRouteParameters in order to make it work
Steps to reproduce
Create a form
use FOS\CKEditorBundle\Form\Type\CKEditorType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
Environment
Symfony 4.4.2 PHP 7.3
Subject
I think there is an issue with configuration overriding. When I set a default configuration, the overriding applies to only first level in the array. I want to add parameters to
filebrowserImageBrowseRouteParameters
but currently I need to redefine all keys offilebrowserImageBrowseRouteParameters
in order to make it workSteps to reproduce
class NewsType extends AbstractType { public function buildForm(FormBuilderInterface $builder, array $options) { $builder ->add('summary',CKEditorType::class, array( 'required' => false, 'config_name' => 'admin', 'config' => [ 'filebrowserImageBrowseRouteParameters' => [ 'context' => 'news' ], 'filebrowserUploadRouteParameters' => [ 'context' => 'news' ], ] )); } }
Expected results
At the end of
FOS\CKEditorBundle\Form\Type\CKEditorType::resolveConfig
,$config['filebrowserImageBrowseRouteParameters']
should contain 3 items:provider
,action
andcontext
Actual results
$config['filebrowserImageBrowseRouteParameters']
contains only one item:context
The upload does not work in that context.
How to fix
In the file https://github.com/FriendsOfSymfony/FOSCKEditorBundle/blob/2.x/src/Form/Type/CKEditorType.php#L72
Prevously:
Proposal:
There may be a BC break if that change is made
Regards