stfalcon / TinymceBundle

Bundle for connecting TinyMCE (WYSIWYG editor) to your Symfony2 project
259 stars 154 forks source link

Support Symfony 6 #256

Closed MonsieurV closed 9 months ago

MonsieurV commented 2 years ago

Tester, seems to work seamlessly on Symfony 6.0

To test it, in your composer.json:

   "repositories": [
        {
            "type": "git",
            "url": "https://github.com/MonsieurV/TinymceBundle"
        }
    ],
    [...],
   "require": {
        "stfalcon/tinymce-bundle": "dev-master",
        [...]
   }

Thanks for the lib @stfalcon :)

walterbak commented 2 years ago

News about this pull request? When will we be able to use TinymceBundle on SF6(.1)?

kcaporaso commented 1 year ago

@MonsieurV did this actually work and load for you as-is? Did you get errors about There is no extension able to load the configuration for "stfalcon_tinymce"? I am getting that error when I forked this repo and updated for sf6.0 myself. Curious of your results. If it worked completely well for you would you please show your working composer.json? Thanks, Kevin

Full context of error: Executing script cache:clear [KO] [KO] Script cache:clear returned with error code 1 !! Cannot load Zend OPcache - it was already loaded !! !! In FileLoader.php line 172: !! !! There is no extension able to load the configuration for "stfalcon_tinymce" !! (in "/private/var/www/fresh.com/config/packages/stfalcon_tinymce.y !! aml"). Looked for namespace "stfalcon_tinymce", found ""doctrine", "doctrin !! e_migrations", "jms_serializer", "knp_paginator", "sensio_framework_extra", !! "stof_doctrine_extensions", "monolog", "vich_uploader", "framework", "twig !! ", "web_profiler", "liip_imagine", "webpack_encore", "mobile_detect", "secu !! rity", "maker"" in /private/var/www/fresh.com/config/packages/stfal !! con_tinymce.yaml (which is being imported from "/private/var/www/fresh.com/src/Kernel.php"). !! !! !! In YamlFileLoader.php line 785: !! !! There is no extension able to load the configuration for "stfalcon_tinymce" !! (in "/private/var/www/fresh.com/config/packages/stfalcon_tinymce.y !! aml"). Looked for namespace "stfalcon_tinymce", found ""doctrine", "doctrin !! e_migrations", "jms_serializer", "knp_paginator", "sensio_framework_extra", !! "stof_doctrine_extensions", "monolog", "vich_uploader", "framework", "twig !! ", "web_profiler", "liip_imagine", "webpack_encore", "mobile_detect", "secu !! rity", "maker"". !! !! !! Script @auto-scripts was called via post-update-cmd

MonsieurV commented 1 year ago

Hi @kcaporaso,

Yep, it does.

A composer.json extract (note the repositories entry):

{
    "repositories": [
        {
            "type": "git",
            "url": "https://github.com/MonsieurV/TinymceBundle"
        }
    ],
    "require": {
        "twig/twig": "^v3",
        "stfalcon/tinymce-bundle": "dev-master",
        "symfony/flex": "^2",
        "symfony/runtime": "6.*",
        "twig/extra-bundle": "^3.4",
        "symfony/twig-bundle": "6.1.*",
    },
    "conflict": {
        "symfony/symfony": "*"
    },
    "extra": {
        "symfony": {
            "require": "6.1.*"
        }
    }
}
kcaporaso commented 1 year ago

Hi @MonsieurV , I have precisely that as well, yet I get the error during the composer update.


    "name": "testing",
    "license": "proprietary",
    "type": "project",
    "minimum-stability": "dev",
    "autoload": {
        "psr-4": {
            "App\\": "src/"
        }
    },
    "autoload-dev": {
        "psr-4": {
            "App\\Tests\\": "tests/"
        }
    },
    "repositories": [
        {
            "type": "git",
            "url": "https://github.com/MonsieurV/TinymceBundle"
        }
    ],
    "require": {
        "php": "^8.1",
        "ext-ctype": "*",
        "ext-iconv": "*",
        "behat/transliterator": "~1.2",
        "doctrine/cache": "~1.6",
        "doctrine/collections": "~1.4",
        "doctrine/common": "^3.0",
        "doctrine/data-fixtures": "~1.3",
        "doctrine/dbal": "^2.6",
        "doctrine/doctrine-bundle": "^2.4",
        "doctrine/doctrine-migrations-bundle": "3.2.2",
        "doctrine/inflector": "2.0.*",
        "doctrine/migrations": "^3.0",
        "doctrine/orm": "^2.9",
        "fig/link-util": "^1.1",
        "gedmo/doctrine-extensions": "^3.1",
        "guzzlehttp/guzzle": "^7.3",
        "incenteev/composer-parameter-handler": "~2.1.1",
        "jms/metadata": "^2.4.0",
        "jms/serializer": "^3.14",
        "jms/serializer-bundle": "4.0.*",
        "knplabs/knp-components": "4.0.*",
        "knplabs/knp-paginator-bundle": "6.0.*",
        "liip/imagine-bundle": "3.x-dev",
        "monolog/monolog": "^1.22",
        "phpcollection/phpcollection": "0.4.0",
        "sensio/framework-extra-bundle": "6.2.*",
        "stfalcon/tinymce-bundle": "dev-master",
        "stof/doctrine-extensions-bundle": "^1.6",
        "symfony/apache-pack": "^1.0",
        "symfony/asset": "6.0.*",
        "symfony/cache": "6.0.*",
        "symfony/config": "6.0.*",
        "symfony/console": "6.0.*",
        "symfony/dependency-injection": "6.0.*",
        "symfony/doctrine-bridge": "6.0.*",
        "symfony/dotenv": "6.0.*",
        "symfony/event-dispatcher": "6.0.*",
        "symfony/expression-language": "6.0.*",
        "symfony/flex": "^2.1",
        "symfony/form": "6.0.*",
        "symfony/framework-bundle": "6.0.*",
        "symfony/http-foundation": "6.0.*",
        "symfony/http-kernel": "6.0.*",
        "symfony/lock": "6.0.*",
        "symfony/mime": "6.0.*",
        "symfony/monolog-bridge": "6.0.*",
        "symfony/monolog-bundle": "^3.3",
        "symfony/options-resolver": "6.0.*",
        "symfony/property-access": "6.0.*",
        "symfony/property-info": "6.0.*",
        "symfony/rate-limiter": "6.0.*",
        "symfony/routing": "6.0.*",
        "symfony/runtime": "6.0.*",
        "symfony/security-bundle": "6.0.*",
        "symfony/security-core": "6.0.*",
        "symfony/security-csrf": "6.0.*",
        "symfony/security-guard": "5.4.*",
        "symfony/security-http": "6.0.*",
        "symfony/serializer": "6.0.*",
        "symfony/string": "6.0.*",
        "symfony/mailer": "6.0.*",
        "symfony/translation": "*",
        "symfony/twig-bridge": "6.0.*",
        "symfony/twig-bundle": "6.0.*",
        "symfony/validator": "6.0.*",
        "symfony/web-link": "4.4.*",
        "symfony/web-profiler-bundle": "6.0.*",
        "symfony/webpack-encore-bundle": "^1.1",
        "symfony/yaml": "*",
        "tattali/mobile-detect-bundle": "2.2.*",
        "twig/twig": "^3.0",
        "vich/uploader-bundle": "2.0.*"
    },
    "require-dev": {
        "phpunit/phpunit": "9.5.x-dev",
        "rector/rector": "0.14.x-dev",
        "symfony/browser-kit": "6.0.*",
        "symfony/css-selector": "6.0.*",
        "symfony/maker-bundle": "1.48.0",
        "symfony/phpunit-bridge": "^4.0",
        "symfony/stopwatch": "6.0.*"
    },
    "config": {
        "preferred-install": {
            "*": "dist"
        },
        "sort-packages": true,
        "allow-plugins": {
            "symfony/flex": true,
            "symfony/runtime": true
        }
    },
    "scripts": {
        "auto-scripts": {
            "cache:clear": "symfony-cmd",
            "assets:install %PUBLIC_DIR%": "symfony-cmd"
        },
        "post-install-cmd": [
            "@auto-scripts"
        ],
        "post-update-cmd": [
            "@auto-scripts"
        ]
    },
    "conflict": {
        "symfony/symfony": "*"
    },
    "extra": {
        "symfony": {
            "allow-contrib": true,
            "require": "6.1.*"
        }
    }

ERROR:
`Executing script cache:clear [KO]
 [KO]
Script cache:clear returned with error code 1
!!  
!!  In FileLoader.php line 172:
!!                                                                                 
!!    There is no extension able to load the configuration for "stfalcon_tinymce"  
!!     (in "/private/var/www/www.fresh.com/config/packages/stfalcon_tinymce.y  
!!    aml"). Looked for namespace "stfalcon_tinymce", found ""doctrine", "doctrin  
!!    e_migrations", "jms_serializer", "knp_paginator", "sensio_framework_extra",  
!!     "stof_doctrine_extensions", "monolog", "vich_uploader", "framework", "twig  
!!    ", "web_profiler", "liip_imagine", "webpack_encore", "mobile_detect", "secu  
!!    rity", "maker"" in /private/var/www/www.fresh.com/config/packages/stfal  
!!    con_tinymce.yaml (which is being imported from "/private/var/www/www.vspdir  
!!    ect.com/src/Kernel.php").                                                    
!!                                                                                 
!!  
!!  In YamlFileLoader.php line 785:
!!                                                                                 
!!    There is no extension able to load the configuration for "stfalcon_tinymce"  
!!     (in "/private/var/www/www.fresh.com/config/packages/stfalcon_tinymce.y  
!!    aml"). Looked for namespace "stfalcon_tinymce", found ""doctrine", "doctrin  
!!    e_migrations", "jms_serializer", "knp_paginator", "sensio_framework_extra",  
!!     "stof_doctrine_extensions", "monolog", "vich_uploader", "framework", "twig  
!!    ", "web_profiler", "liip_imagine", "webpack_encore", "mobile_detect", "secu  
!!    rity", "maker"".                                                             
!!                                                                                 
!!  
!!  
Script @auto-scripts was called via post-update-cmd

Any thoughts around a possible solution/suggestion for me to get past this remaining as I move from sf5.4 to sf6.x?
Many thanks,
Kevin
MonsieurV commented 1 year ago

@kcaporaso I don't have any error like that while running cache:clear commands or when installing from draft in a CI.

Seems like the stfalcon_tinymce package is not loaded at all in your case. I'm not expert enough to judge. You may try an explicit composer install, and if that doesn't work try again by removing first your existing composer.lock (and then maybe all your vendor repository).

You should also try to remove all the Symfony manually (removing the var/cache/dev dir).

kcaporaso commented 1 year ago

@MonsieurV Thanks for your suggestions. I found the issue, most bundles' recipes will add the bundle to bundles.php, this one was missing from it. So, manually adding it: Stfalcon\Bundle\TinymceBundle\StfalconTinymceBundle::class => ['all' => true], Resolved my issue.

umpirsky commented 9 months ago

@fre5h @Huron Can we merge this please?