2amigos / yii2-ckeditor-widget

CKEditor WYSIWYG widget for Yii2.
https://2amigos.us/open-source/ckeditor-widget
Other
172 stars 112 forks source link

only standard preset working after update to 2.* version #80

Closed akulyk closed 7 years ago

akulyk commented 7 years ago

got a problem with preset settings

$form->field($model, 'short_desc')->widget(CKEditor::className(), [ 'options' => ['rows' => 6], 'preset' => 'full', //'skin'=>'moono', 'enableKCFinder' => true, ]) but only standard toolbar shows

akulyk commented 7 years ago

2016-09-24 17 33 57

tonydspaniard commented 7 years ago

@akulyk do you mind testing on master branch?

tonydspaniard commented 7 years ago

@akulyk by the way... I think you are not using this extension:

'enableKCFinder' => true,

That property is not from here.

akulyk commented 7 years ago

well 'enableKCFinder' => true, maybe not, but I have only updated my project by composer and got this. With version 1.0.4, all good

tsanchev commented 7 years ago

After updating the widget to the latest version i have this error: Invalid Parameter – yii\base\InvalidParamException Trying to copy a directory to itself or a subdirectory.

Tracing error down the stack

tonydspaniard commented 7 years ago

@tsanchev do you mind trying the lastest on master branch and check whether that stills happening?

tsanchev commented 7 years ago

@tonydspaniard still the same same error.

This is what how i'm using the widget

` <?= $form->field($model, 'terms_and_conditions_en')->widget(CKEditor::className(), [ 'options' => ['rows' => 10],

            'preset' => 'custom',
            'clientOptions' =>
                [
                    'toolbarGroups' => [
                        ['name' => 'paragraph', 'groups' => [ 'list', 'indent', 'align' ]],
                        ['name' => 'basicstyles', 'groups' => ['basicstyles', 'cleanup']],
                        ['name' => 'insert'],
                        ['name' => 'bootstrap', 'groups' => [ 'rt' ]],
                        ['name' => 'links'],
                        ['name' => 'styles', 'groups' => [ 'Format', 'Styleselect' ]],
                    ],
                    'removeButtons' => 'Flash,Smiley,PageBreak,SpecialChar,Image,HorizontalRule,Styles,Font,FontSize,Anchor',
                ],

        ]) ?>

`

Even if i remove all clientOptions I still get the same error. Prior to version 2.0.0 there was no error and everything was working fine.

HanafiAhmat commented 7 years ago

Hi @tonydspaniard ,

I tried using master branch but i got the error described in https://github.com/2amigos/yii2-ckeditor-widget/issues/79.

Based on this commit, https://github.com/2amigos/yii2-ckeditor-widget/commit/11deb530ab77fc91f89a444fd973d1e88dd67fb4, CKEditorWidgetAsset init function was removed and $sourcePath value assignment was done on class attribute declaration.

Maybe value concatenation can be done when assigning it to an attribute there on php 5.6 and above. As mentioned by @aripjanovsh, he encountered the syntax error when he used php 5.5. I am using php 5.4.

After removing line 21 public $sourcePath = __DIR__ . '/assets'; and added init function

    public function init()
    {
        $this->sourcePath = __DIR__ . '/assets';
        parent::init();
    }

Invalid Parameter – yii\base\InvalidParamException is gone.

After implementing the init function, presets work as per normal.

jeesus commented 7 years ago

Same problem over here. Full and standard preset look exactly the same, lacking even elementary alignment buttons.

tonydspaniard commented 7 years ago

Checking...

jeesus commented 7 years ago

@tonydspaniard check my answer here.

tonydspaniard commented 7 years ago

Thanks @jeesus. Updating the library.

tonydspaniard commented 7 years ago

@akulyk @jeesus @HanafiAhmat @tsanchev please guys, update to latest and let me know if it works for you. Thanks!