After updating sf2 and its bundles ckedtiro form type stopped working. Note i had to update CKEditorType class CKEditorType in order to avoid errors complaining about not implementing FormTypeInterface correctly.
That's the error i got after updating class CKEditorType:
Notice: Undefined index: toolbar in /home/sibok/public_html/SalleBcn/vendor/bundles/Ivory/CKEditorBundle/Form/Type/CKEditorType.php line 21
I modified class CKEditorType leaving it as:
setAttribute('toolbar', $options['toolbar'])
->setAttribute('ui_color', $options['ui_color']);
}
/**
- {
@inheritdoc}
*/
public function buildView(\Symfony\Component\Form\FormView $view, \Symfony\Component\Form\FormInterface $form)
{
$view
->setVar('toolbar', $form->getAttribute('toolbar'))
->setVar('ui_color', $form->getAttribute('ui_color'));
}
/**
- {
@inheritdoc}
*/
public function setDefaultOptions(OptionsResolverInterface $resolver)
{
$resolver->setDefaults(array(
'required' => false,
'toolbar' => array(
array(
'name' => 'document',
'items' => array('Source','-','Save','NewPage','DocProps','Preview','Print','-','Templates')
),
array(
'name' => 'clipboard',
'items' => array('Cut','Copy','Paste','PasteText','PasteFromWord','-','Undo','Redo')
),
array(
'name' => 'editing',
'items' => array('Find','Replace','-','SelectAll','-','SpellChecker', 'Scayt')
),
array(
'name' => 'forms',
'items' => array('Form', 'Checkbox', 'Radio', 'TextField', 'Textarea', 'Select', 'Button', 'ImageButton', 'HiddenField')
),
'/',
array(
'name' => 'basicstyles',
'items' => array('Bold','Italic','Underline','Strike','Subscript','Superscript','-','RemoveFormat')
),
array(
'name' => 'paragraph',
'items' => array('NumberedList','BulletedList','-','Outdent','Indent','-','Blockquote','CreateDiv','-','JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock','-','BidiLtr','BidiRtl')
),
array(
'name' => 'links',
'items' => array('Link','Unlink','Anchor')
),
array(
'name' => 'insert',
'items' => array('Image','Flash','Table','HorizontalRule','Smiley','SpecialChar','PageBreak')
),
'/',
array(
'name' => 'styles',
'items' => array('Styles','Format','Font','FontSize')
),
array(
'name' => 'colors',
'items' => array('TextColor','BGColor')
),
array(
'name' => 'tools',
'items' => array('Maximize', 'ShowBlocks','-','About')
)
),
'ui_color' => null
));
$resolver->addAllowedValues(array('required' => array(false)));
}
/**
- {
@inheritdoc}
*/
public function getParent(array $options)
{
return 'textarea';
}
/**
- {
@inheritdoc}
*/
public function getName()
{
return 'ckeditor';
}
}