2amigos / yii2-ckeditor-widget

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

Preset mode not working as expected #106

Closed namrataw closed 6 years ago

namrataw commented 7 years ago

I am using different preset modes to get all controls in toolbar but no luck.

Here is the code which I am using for basic preset, <?= $form->field($model, 'body') ->widget(CKEditor::className(), [ 'options' => ['rows' => 6, 'class' => 'color_picker'], 'preset' => 'basic' ]) ?>

download

I was expecting the same with full but half of he controls are missing like text alignment, font color etc

tonydspaniard commented 7 years ago

what about 'custom' and configure your toolbar yourself? Nevertheless, it should contain those controls: https://github.com/2amigos/yii2-ckeditor-widget/blob/master/src/presets/full.php

clearazil commented 7 years ago

The preset setting also doesn't work for me. I seem to be getting the standard preset, no matter what I specify.

I tried a custom preset, but that didn't change anything. This is with version 2.0 and 2.0.1. 2.0.2 wouldn't install because ""minimum-stability": "stable"," setting in composer.json, so I didn't try that one.

I went back to version 1..0.4, and with that the presets are working again.

tonydspaniard commented 7 years ago

Hey @dvanderh @schmunk42 and I have been working and the latest version work with presets. Check it out!

schmunk42 commented 7 years ago

@dvanderh Try 2.1.0 - https://github.com/2amigos/yii2-ckeditor-widget/commit/670a5f22ce70109e3ae34c1042b0034798fda137#diff-b5d0ee8c97c7abd7e3fa29b9a27d1780R30

heggi commented 7 years ago

Has same problem. 2.1.0 installing ckeditor standard version (ckeditor.js file size 558524 bytes) full version of ckeditor.js has 618831 bytes

heggi commented 7 years ago

Add to composer.json "ckeditor/ckeditor": "dev-full/latest" this fix my problem, but 2amigos/yii2-ckeditor-widget downgraded to 1.0.2 version :(

schmunk42 commented 7 years ago

I can confirm that I am also not getting the full version installed.

@heggi Could you try this:

"ckeditor/ckeditor": "dev-full/4.7.x as 4.7.0"

I'd recommend this as the way to install full since it seems that there's no way to get the full package with stability stable.

[update]

If you need to use a fixed a version

"ckeditor/ckeditor": "dev-master#b6ab4c126861b21d357a619d92b42b83fd2d291f as 4.7.0"
namrataw commented 7 years ago

I tried the custom as well as full preset mode but no luck. The issue is in version I must say as the latest stable version dev-full also not getting installed. I switched to different widget. thanks.

schmunk42 commented 7 years ago

Just to note it here: Clean all of your assets, when testing this.

Would be helpful to see your error messages.

[edit]

You still can require 2.0.* of this widget, instead of switching to another one.

tonydspaniard commented 7 years ago

@heggi @namrataw do you mind checking whether you have the latest composer-plugin + composer versions?

Then, please, show the configuration of your composer.json.

@schmunk42 and I have been testing and it works well on our ends. It could be an issue with your composer and composer-asset plugin versions.

$ composer self-update 
$ composer global require "fxp/composer-asset-plugin:~1.3"

[edit]

"require": {
        "2amigos/yii2-ckeditor-widget": "~2.1"
    },
heggi commented 7 years ago
composer --version
Composer version 1.4.2 2017-05-17 08:17:52

composer selfupdate
You are already using composer version 1.4.2 (stable channel)

composer global show
fxp/composer-asset-plugin v1.3.1 NPM/Bower Dependency Manager for Composer

{
    "name": "xxxx",
    "description": "xxxx",
    "type": "project",
    "minimum-stability": "stable",
    "require": {
        "php": ">=5.4.0",
        "yiisoft/yii2": "~2.0.11",
        "yiisoft/yii2-redis": "^2.0",
        "yiisoft/yii2-mongodb": "^2.1",
        "yiisoft/yii2-bootstrap": "*",
        "twbs/bootstrap": "^3",
        "components/font-awesome": "^4.7.0",
        "heggi/ptsans-webfont": "dev-master",
        "heggi/scada-webfont": "dev-master",
        "erikflowers/weather-icons": "dev-master",
        "bower-asset/lato-font": "^2.0.0",
        "bower-asset/eonasdan-bootstrap-datetimepicker": "^4.17.45",
        "bower-asset/slick-carousel": "*",
        "bower-asset/speakingurl": "*",
        "embed/embed": "*",
        "mongosoft/yii2-mongodate-behavior": "*",
        "bower-asset/jssocials": "*",
        "makseo/illbeback": "dev-master",
        "2amigos/yii2-ckeditor-widget" : "^2.0.2",
        "kartik-v/yii2-widget-datetimepicker": "*",
        "wbraganca/yii2-dynamicform": "*",
        "yiisoft/yii2-imagine": "~2.1.0",
        "kartik-v/yii2-widget-select2": "@dev",
        "bower-asset/toastr": "*",
        "yiisoft/yii2-httpclient": "*",
        "minishlink/web-push": "^1.4.2",
        "zelenin/yii2-rss": "*",
        "yiisoft/yii2-swiftmailer": "~2.0.0",
        "ckeditor/ckeditor": "dev-full/stable"
    },
    "require-dev": {
        "yiisoft/yii2-gii": "~2.0.0"
    },
    "config": {
        "process-timeout": 1800
    },
    "extra": {
        "asset-installer-paths": {
            "npm-asset-library": "vendor/npm",
            "bower-asset-library": "vendor/bower"
        }
    },
    "repositories": [
        {
            "type": "git",
            "url": "https://github.com/heggi/ptsans-webfont"
        },
        {
            "type": "git",
            "url": "https://github.com/heggi/scada-webfont"
        },
        {
            "type":"package",
            "package": {
                "name": "erikflowers/weather-icons",
                "version":"dev-master",
                "source": {
                    "url": "https://github.com/erikflowers/weather-icons.git",
                    "type": "git",
                    "reference":"master"
                }
            }
        },
        {
            "type":"package",
            "package": {
                "name": "makseo/illbeback",
                "version":"dev-master",
                "source": {
                    "url": "https://github.com/makseo/illbeback.git",
                    "type": "git",
                    "reference":"master"
                }
            }
        }
    ]
}

If i remove "ckeditor/ckeditor": "dev-full/stable" and change version of 2amigos/yii2-ckeditor-widget to 2.1, will be installed standard version of ckeditor (master branch)

tonydspaniard commented 7 years ago

@heggi Do you mind trying this:


{
    "name": "xxxx",
    "description": "xxxx",
    "type": "project",
    "minimum-stability": "dev",
    "prefer-stable": true,
    "require": {
        "php": ">=5.4.0",
        "yiisoft/yii2": "~2.0.11",
        "yiisoft/yii2-redis": "^2.0",
        "yiisoft/yii2-mongodb": "^2.1",
        "yiisoft/yii2-bootstrap": "*",
        "twbs/bootstrap": "^3",
        "components/font-awesome": "^4.7.0",
        "heggi/ptsans-webfont": "dev-master",
        "heggi/scada-webfont": "dev-master",
        "erikflowers/weather-icons": "dev-master",
        "bower-asset/lato-font": "^2.0.0",
        "bower-asset/eonasdan-bootstrap-datetimepicker": "^4.17.45",
        "bower-asset/slick-carousel": "*",
        "bower-asset/speakingurl": "*",
        "embed/embed": "*",
        "mongosoft/yii2-mongodate-behavior": "*",
        "bower-asset/jssocials": "*",
        "makseo/illbeback": "dev-master",
        "2amigos/yii2-ckeditor-widget" : "~2.1",
        "kartik-v/yii2-widget-datetimepicker": "*",
        "wbraganca/yii2-dynamicform": "*",
        "yiisoft/yii2-imagine": "~2.1.0",
        "kartik-v/yii2-widget-select2": "@dev",
        "bower-asset/toastr": "*",
        "yiisoft/yii2-httpclient": "*",
        "minishlink/web-push": "^1.4.2",
        "zelenin/yii2-rss": "*",
        "yiisoft/yii2-swiftmailer": "~2.0.0"
    },
    "require-dev": {
        "yiisoft/yii2-gii": "~2.0.0"
    },
    "config": {
        "process-timeout": 1800,
        "fxp-asset": {
            "installer-paths": {
                "npm-asset-library": "vendor/npm",
                "bower-asset-library": "vendor/bower"
            }
        }
    },
    "repositories": [
        {
            "type": "git",
            "url": "https://github.com/heggi/ptsans-webfont"
        },
        {
            "type": "git",
            "url": "https://github.com/heggi/scada-webfont"
        },
        {
            "type":"package",
            "package": {
                "name": "erikflowers/weather-icons",
                "version":"dev-master",
                "source": {
                    "url": "https://github.com/erikflowers/weather-icons.git",
                    "type": "git",
                    "reference":"master"
                }
            }
        },
        {
            "type":"package",
            "package": {
                "name": "makseo/illbeback",
                "version":"dev-master",
                "source": {
                    "url": "https://github.com/makseo/illbeback.git",
                    "type": "git",
                    "reference":"master"
                }
            }
        }
    ]
}
tonydspaniard commented 7 years ago

@heggi ping

heggi commented 7 years ago

I create new empty project

$ composer create yiisoft/yii2-app-basic
$ cd yii2-app-basic/
$ composer require 2amigos/yii2-ckeditor-widget:~2.1
$ ls -l vendor/ckeditor/ckeditor/ckeditor.js
-rw-r--r-- 1 Heggi 197121 558524 июн 16 01:49 vendor/ckeditor/ckeditor/ckeditor.js

558524 - standard version

I can not install 2amigos/yii2-ckeditor-widget:2.0.2 (because require ckeditor/ckeditor:dev-full/stable but these conflict with minimum-stability) I must install first ckeditor/ckeditor:dev-full/stable and then 2amigos/yii2-ckeditor-widget:2.0.2 After I get full version

$ ls -l vendor/ckeditor/ckeditor/ckeditor.js
-rw-r--r-- 1 Heggi 197121 620014 июн 16 01:59 vendor/ckeditor/ckeditor/ckeditor.js
$ composer show
2amigos/yii2-ckeditor-widget       2.0.2
ckeditor/ckeditor                  dev-full/stable b6ab4c1
...
schmunk42 commented 7 years ago

See also: https://github.com/ckeditor/ckeditor-releases/issues/41

heggi commented 7 years ago

Maybe need change require in conposer.json from "ckeditor/ckeditor": "~4.7.0+full" to "ckeditor/ckeditor": "dev-full/4.7.x as 4.7.0" (but I don't know whether conflict with minimum-stability will be)

schmunk42 commented 7 years ago

"ckeditor/ckeditor": "~4.7.0+full" is useless IMHO, it was a mistake on our side.

but I don't know whether conflict with minimum-stability will be

The "conflict" with minimum stability you see is, that composer is telling you that it can not install dev-full/stable, because it is a dev- version. And your project is not and should also not be!

If you add ckeditor/ckeditor": "dev-full/4.7.x as 4.7.0"; you're telling composer that it's OK to use a dev version for ckeditor, but this can not be done by a package, only in the project (root composer.json).

tonydspaniard commented 7 years ago

"ckeditor/ckeditor": "~4.7.0+full" is useless IMHO, it was a mistake on our side.

Why now is useless @schmunk42 ? I am starting to be highly confused with mr ckeditor 💃 plugin and its versioning madness

tonydspaniard commented 7 years ago

@heggi have you tried adding this to your composer.json file?

"minimum-stability": "dev",
"prefer-stable": true,

That way you tell that you prefer stable versions of your libraries but is ok if some are on 'dev'.

schmunk42 commented 7 years ago

Why now is useless @schmunk42 ? I am starting to be highly confused with mr ckeditor 💃 plugin and its versioning madness

I think we made a mistake during testing. According to composer docs and the discussion in the linked issues, build meta-data (denoted by a + sign) is completely ignored by composer.

tonydspaniard commented 7 years ago

I think we made a mistake during testing. According to composer docs and the discussion in the linked issues, build meta-data (denoted by a + sign) is completely ignored by composer.

But, we were able to modify the preset... how was that possible?

schmunk42 commented 7 years ago

Maybe the standard distribution included all the stuff we’ve tested. Which plugins require the full build?

Am 22.06.2017 um 10:34 schrieb Antonio Ramirez notifications@github.com:

I think we made a mistake during testing. According to composer docs and the discussion in the linked issues, build meta-data (denoted by a + sign) is completely ignored by composer.

But, we were able to modify the preset... how was that possible?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

tonydspaniard commented 7 years ago

Which plugins require the full build?

http://ckeditor.com/presets-all

CyanoFresh commented 6 years ago

Same issue. Is there any fix?

CyanoFresh commented 6 years ago

composer update with

"minimum-stability": "dev",
"prefer-stable": true,

with

"ckeditor/ckeditor": "dev-full/4.7.x as 4.7.0"

helped

tonydspaniard commented 6 years ago

Thank you @CyanoFresh

namrataw commented 6 years ago

Tried all the options but no luck. Cleared all the assets. Started dummy module for same dev-full was also not helpful Switched to different editor.