Code Monkey home page Code Monkey logo

fosckeditorbundle's Introduction

FOSCKEditorBundle

General: Build Status Latest Stable Version

Quality: Scrutinizer Code Quality Scrutinizer Build Coverage Status Scrutinizer Code Intelligence

Numbers: Total Downloads Monthly Downloads Daily Downloads

Introduction

The bundle provides a CKEditor 4 integration for your Symfony Project. It automatically registers the new ckeditor form type which can be easily as well as highly configured.

Migration from IvoryCKEditorBundle to FOSCKEditorBundle

As IvoryCKEditorBundle was abandoned, FriendsOfSymfony took this bundle over, to help you easily migrate just follow our guide.

Documentation

Please, read the official documentation.

License

This bundle is released under the MIT license. See the included LICENSE file for more information.

Contribute


We love contributors! Ivory is an open source project. If you'd like to contribute, feel free to propose a PR! You can follow the CONTRIBUTING file which will explain you how to set up the project.

fosckeditorbundle's People

Contributors

4l4 avatar adam187 avatar aitboudad avatar amalricbzh avatar artoroz avatar axinet avatar bastien-wink avatar bobvandevijver avatar cassianotartari avatar christopheferreboeuf avatar dunglas avatar eiannone avatar electricmaxxx avatar gelolabs avatar javiereguiluz avatar jmather avatar jmsche avatar ktherage avatar kunicmarko20 avatar lsmith77 avatar lucassimonin avatar lyrkan avatar manuelj555 avatar maxailloud avatar mbabker avatar ruscon avatar stof avatar tnajanssen avatar vincentlanglet avatar xabbuh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fosckeditorbundle's Issues

Enable Packagist

do not forget to add 3 maintainers there and enable auto update.

Default Branch

My suggestion is that we create 1.x from master and continue our work there. So 1.x would be stable and master unstable. We merge 1.x into master and from master we release next majors.

Bad Check

} elseif ($containerOrJsonBuilder instanceof JsonBuilder) {
$jsonBuilder = $containerOrJsonBuilder;
if ($router === null) {
throw new \InvalidArgumentException(sprintf('%s 2nd argument must not be null when using %s as first argument', __METHOD__, JsonBuilder::class));
} elseif ($packages === null) {
throw new \InvalidArgumentException(sprintf('%s 3rd argument must not be null when using %s as first argument', __METHOD__, JsonBuilder::class));
} elseif ($requestStack === null) {
throw new \InvalidArgumentException(sprintf('%s 4th argument must not be null when using %s as first argument', __METHOD__, JsonBuilder::class));
} elseif ($templating === null) {
throw new \InvalidArgumentException(sprintf('%s 5th argument must not be null when using %s as first argument', __METHOD__, JsonBuilder::class));
}
} else {

Here we always check instanceof JsonBuilder::class

This should be fixed.

Lazy-load the command in Symfony 3.4+

The command is defined as a service (which is needed to support Symfony 4). But it is currently not lazy-loaded, because the name is not accessible at compile time.

there is 2 ways to fix this:

  • provide the command name in the tag registering the command (thanks to the alias attribute)
  • set the name in a static property (check the Symfony 3.4+ codebase to find the name of this property in the Command class, I don't remember it right now)

Circular reference detected

Symfony packages

symfony/monolog-bundle     v3.2.0  v3.2.0 Symfony MonologBundle
symfony/phpunit-bridge     v2.8.39 v4.0.8 Symfony PHPUnit Bridge
symfony/polyfill-apcu      v1.7.0  v1.7.0 Symfony polyfill backporting apcu_* functions to lower PHP versions
symfony/polyfill-intl-icu  v1.7.0  v1.7.0 Symfony polyfill for intl's ICU-related data and classes
symfony/polyfill-mbstring  v1.7.0  v1.7.0 Symfony polyfill for the Mbstring extension
symfony/polyfill-php54     v1.7.0  v1.7.0 Symfony polyfill backporting some PHP 5.4+ features to lower PHP versions
symfony/polyfill-php55     v1.7.0  v1.7.0 Symfony polyfill backporting some PHP 5.5+ features to lower PHP versions
symfony/polyfill-php56     v1.7.0  v1.7.0 Symfony polyfill backporting some PHP 5.6+ features to lower PHP versions
symfony/polyfill-php70     v1.7.0  v1.7.0 Symfony polyfill backporting some PHP 7.0+ features to lower PHP versions
symfony/polyfill-util      v1.7.0  v1.7.0 Symfony utilities for portability of PHP codes
symfony/security-acl       v3.0.1  v3.0.1 Symfony Security Component - ACL (Access Control List)
symfony/swiftmailer-bundle v2.6.7  v3.2.2 Symfony SwiftmailerBundle
symfony/symfony            v2.8.39 v3.4.8 The Symfony PHP framework

Subject

Clean install on sf2.8 project without any kind of configuration, added form type to form type and I get an error.

Steps to reproduce

Install bundle and add form type to any form

Expected results

working page with ckeditor

Actual results

ServiceCircularReferenceException in Container.php line 264:
Circular reference detected for service "templating", path: "fos_rest.versioning.listener -> fos\restbundle\view\viewhandlerinterface -> templating -> twig -> fos_ck_editor.twig_extension -> fos_ck_editor.renderer".

Stack Trace

in Container.php line 264 at Container->get('templating', '2') in appDevDebugProjectContainer.php line 1991 at appDevDebugProjectContainer->getFosCkEditor_RendererService() in Container.php line 297 at Container->get('fos_ck_editor.renderer') in appDevDebugProjectContainer.php line 2041 at appDevDebugProjectContainer->getFosCkEditor_TwigExtensionService() in Container.php line 297 at Container->get('fos_ck_editor.twig_extension') in appDevDebugProjectContainer.php line 6794 at appDevDebugProjectContainer->getTwigService() in Container.php line 297 at Container->get('twig') in appDevDebugProjectContainer.php line 6343 at appDevDebugProjectContainer->getTemplatingService() in Container.php line 297 at Container->get('templating', '2') in appDevDebugProjectContainer.php line 1927 at appDevDebugProjectContainer->getFos_Restbundle_View_ViewhandlerinterfaceService() in Container.php line 297 at Container->get('fos\restbundle\view\viewhandlerinterface') in appDevDebugProjectContainer.php line 2316 at appDevDebugProjectContainer->getFosRest_Versioning_ListenerService() in Container.php line 297 at Container->get('fos_rest.versioning.listener') in ContainerAwareEventDispatcher.php line 169 at ContainerAwareEventDispatcher->lazyLoad('kernel.request') in ContainerAwareEventDispatcher.php line 114 at ContainerAwareEventDispatcher->getListeners('kernel.request') in TraceableEventDispatcher.php line 238 at TraceableEventDispatcher->preProcess('kernel.request') in TraceableEventDispatcher.php line 128 at TraceableEventDispatcher->dispatch('kernel.request', object(GetResponseEvent)) in HttpKernel.php line 116 at HttpKernel->handleRaw(object(Request), '2') in HttpKernel.php line 57 at HttpKernel->handle(object(Request), '2', false) in ContainerAwareHttpKernel.php line 67 at ContainerAwareHttpKernel->handle(object(Request), '2', false) in ExceptionListener.php line 55 at ExceptionListener->onKernelException(object(GetResponseForExceptionEvent), 'kernel.exception', object(TraceableEventDispatcher)) at call_user_func(array(object(ExceptionListener), 'onKernelException'), object(GetResponseForExceptionEvent), 'kernel.exception', object(TraceableEventDispatcher)) in WrappedListener.php line 61 at WrappedListener->__invoke(object(GetResponseForExceptionEvent), 'kernel.exception', object(ContainerAwareEventDispatcher)) at call_user_func(object(WrappedListener), object(GetResponseForExceptionEvent), 'kernel.exception', object(ContainerAwareEventDispatcher)) in EventDispatcher.php line 184 at EventDispatcher->doDispatch(array(object(WrappedListener), object(WrappedListener), object(WrappedListener)), 'kernel.exception', object(GetResponseForExceptionEvent)) in EventDispatcher.php line 46 at EventDispatcher->dispatch('kernel.exception', object(GetResponseForExceptionEvent)) in TraceableEventDispatcher.php line 133 at TraceableEventDispatcher->dispatch('kernel.exception', object(GetResponseForExceptionEvent)) in HttpKernel.php line 212 at HttpKernel->handleException(object(ServiceCircularReferenceException), object(Request), '1') in HttpKernel.php line 68 at HttpKernel->handle(object(Request), '1', true) in ContainerAwareHttpKernel.php line 67 at ContainerAwareHttpKernel->handle(object(Request), '1', true) in Kernel.php line 183 at Kernel->handle(object(Request)) in app_dev.php line 28

Add phpunit groups

I suggest we add @group to tests that run install and download stuff, for me at least, build takes so much time locally and I do not want to wait that long to confirm if I broke stuff.

Adding @group installation to:

https://github.com/FriendsOfSymfony/FOSCKEditorBundle/blob/master/Command/CKEditorInstallerCommand.php
and
https://github.com/FriendsOfSymfony/FOSCKEditorBundle/blob/master/Installer/CKEditorInstaller.php

would allow us to run tests with phpunit --exclude-group installation and build is done in 15 seconds, and then we leave travis to confirm if installation works.

Drop PHP templates?

Currently, there are some PHP template and twig templates, should we consider dropping PHP ones and sticking to twig only?

Handle and communicate migration

hints in anouncments:

  • Blog Post in Symfony Blog
  • @ElectricMaxxx write an own post on company blog also

more:

  • Readme section
  • migration page in docs
  • hints on several other places in the docs with links to migration page

Drop HHVM support

The CI and Docker environments currently support HHVM. But Symfony dropped HHVM support after they announced that they would not care about PHP compat anymore.
We should not care about testing HHVM compat for this bundle.

Rework the way the model managers are working

Currently, all the model services (except the ToolbarManager) are stateful mutable objects, which are cloned in the form type before being mutated. This makes them unsuited for being registered as services (the way they are used does not correspond to services).

These services should become builder objects instantiated at the right time in the form type (a factory service might be provided in case this needs to be an extension point)

What should come first?

In chat @kunicmarko20 an i had a discussion what to include into a v1.0. What do you think?
From my POV, i would see a goal having a release as fast as possible, which means:

  • fixes to get bundle working and consistent
  • SF4 comaptibility
    Doing so we would have a smal step only for migration from former repo to this one. I know that we have several ideas and stuff which needs to be fixed โ€“ even with BC-breaks. But lets get it out and work on a new major afterwards, what do you think?

At least we should have something stable to get the other bundles/packages like CMF, Sonata, into the road of releasing their SF4 compatible versions.

Add PHPStan

This would be a good addition at one point.

Add missing packages

My IDE (PHPStorm reminds me to add

symfony/http-foundation
symfony/routing

to the list of required packages as they are not required directly. they come through framework-bundle. Is that an a real issue or not?

Reconsider min requirements

currently, the min requirements of the bundle are Symfony 2.7 (and even 2.0 for some components, but I doubt it works due to other requirements) and 5.6 for PHP.

We should at least review these to decide what we do in our new major version

use Twig Namespaces

Stuff like:

new \Twig_SimpleFunction('ckeditor_base_path', [$this, 'renderBasePath'], $options),
new \Twig_SimpleFunction('ckeditor_js_path', [$this, 'renderJsPath'], $options),
new \Twig_SimpleFunction('ckeditor_widget', [$this, 'renderWidget'], $options),
new \Twig_SimpleFunction('ckeditor_destroy', [$this, 'renderDestroy'], $options),
new \Twig_SimpleFunction('ckeditor_plugin', [$this, 'renderPlugin'], $options),
new \Twig_SimpleFunction('ckeditor_styles_set', [$this, 'renderStylesSet'], $options),
new \Twig_SimpleFunction('ckeditor_template', [$this, 'renderTemplate'], $options),

Should be replaced with Twig Namespaces.

Test documentation

We should implement a linter and a build test for docs. Escpecially when i start edititng the rst stuff, there are plenty options to break the docs.

Clean composer.json

The composer.json should be cleaned before 1.0:

  • removing useless suggestion. For instance, suggesting to install Twig to use Twig templates is useless. If they want to use Twig templates, they already have Twig installed (and so don't see the suggestion). If they don't want, they don't care about the suggestion. Suggestions should be about extra packages enhancing the features of the bundle.
  • updating authors to link to github contributors, like in other FOS bundles
  • remove conflict with egeloen/ckeditor-bundle once we don't conflict anymore (i.e. once we have our own namespace)

Download behind proxy

Hello,
after define the proxy configuration, and run the installer command, symfony can't download the file.

Only worked with these changes in the installation command.

if ($proxy) { $context['http']['proxy'] = $proxy; $context['http']['request_fulluri'] = true; }

can i submit a pull request ?

Clean changelog and upgrade files

These files should start empty, as we start over the release history.

and the docs should have a page dedicated to migrating from the Ivory bundle.

Missing Json Builder docs

* :doc:`/usage/ckeditor`
* :doc:`/usage/config`
* :doc:`/usage/toolbar`
* :doc:`/usage/loading`
* :doc:`/usage/language`
* :doc:`/usage/file-browse-upload`
* :doc:`/usage/jquery`
* :doc:`/usage/require-js`
* :doc:`/usage/append-javascript`
* :doc:`/usage/textarea-sync`
* :doc:`/usage/textarea-fallback`
* :doc:`/usage/autoinline`
* :doc:`/usage/inline`
* :doc:`/usage/plugin`
* :doc:`/usage/skin`
* :doc:`/usage/style`
* :doc:`/usage/template`
* :doc:`/usage/version`

We are missing json-builder docs in that index.

Drop the CKEditorScriptHandler

As we already have a CLI command to install CKEditor, we should tell people to use it in their composer scripts instead of using a CKEditorScriptHandler launching the command itself.

this would remove the optional dependency on the old sensio/distribution-bundle

Separate accessors and mutators

This bundle (at least for the FormType) is using the same method for the accessor and the mutator, based on whether a non-null value is provided.
Such kind of API is quite uncommon in the Symfony ecosystem (and harder to typehint)

Make services immutable

Instead of configuring services through setters, which makes them mutable at runtime, they should be configured through the constructor, with no setter.

Create PRs on active bundles that depend on IvoryCKEditorBundle

I checked packagist and this is a list of active libraries in the past 1-2 months that depend on IvoryCKEditorBundle:

My suggestion is to create PRs on that repos and help them move to FOSCKEditorBundle, like I did for SonataFormatterBundle.

This will help us spread the word about moving of the bundle.

Evaluate CKEditor 5

We want to evaluate the newer CKEditor 5. So we want to know how much work it would be and if we can use the current codebase to do so. Lets evaluate and writte down some data from CKEditor 5 docs or by installing and experimenting with an example. We should document it, here in the issue or in wiki section of the package.

Fix all licence header in all files

OLD:


/*
 * This file is part of the Ivory CKEditor package.
 *
 * (c) Eric GELOEN <[email protected]>
 *
 * For the full copyright and license information, please read the LICENSE
 * file that was distributed with this source code.
 */

NEW:


/*
 * This file is part of the FOSCKEditor Bundle.
 *
 * (c) 2018 - 2018 Friends of Symfony
 * (c) 2009 - 2017 Eric GELOEN <[email protected]>
 *
 * For the full copyright and license information, please read the LICENSE
 * file that was distributed with this source code.
 */

Drop deprecated APIs

All deprecated layers of IvoryCKEditorBundle should be dropped when making the 1.0 release of the new bundle, as we are not backward compatible anyway (class name changes for instance).

the migration path would be to upgrade to latest Ivory version, fix deprecations, and then migrate to the FOS bundle.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.