eZ Platform Discussions

How to install ezPlatform 2.0 + eZLegacyBridge 2.0 + Netgen Admin UI Bundle 2.1?


#1

Hi,

Has anybody ever tried to install ezPlatform 2.0 + eZLagcyBridge 2.0 + Netgen Admin UI Bundle 2.1 ?

I’ve applied the procedure from https://www.netgenlabs.com/Blog/How-to-start-using-Netgen-Admin-UI
This procedure was OK for ezPlatform v1.12, and now I meet an issue while installing the bundles with ezPlatform v2.0.

Here is my procedure:

php composer.phar create-project --keep-vcs ezsystems/ezplatform ezplatform
–> Installing ezsystems/ezplatform (v2.0.0.2)

export SYMFONY_ENV="dev"
cd ezplatform/
php bin/console ezplatform:install clean

vi composer.json

...
"scripts": {
    "symfony-scripts": [
        "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
        "eZ\\Bundle\\EzPublishCoreBundle\\Composer\\ScriptHandler::clearCache",
        "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
        "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile",
        "@php bin/console assetic:dump"
    ],
    "legacy-scripts": [
        "eZ\\Bundle\\EzPublishLegacyBundle\\Composer\\ScriptHandler::installAssets",
        "eZ\\Bundle\\EzPublishLegacyBundle\\Composer\\ScriptHandler::installLegacyBundlesExtensions",
        "eZ\\Bundle\\EzPublishLegacyBundle\\Composer\\ScriptHandler::generateAutoloads"
    ],
    "post-install-cmd": [
        "@symfony-scripts",
        "@legacy-scripts"
    ],
    "post-update-cmd": [
        "@symfony-scripts",
        "@legacy-scripts"
    ],
    "post-create-project-cmd": [
        "eZ\\Bundle\\EzPublishCoreBundle\\Composer\\ScriptHandler::installWelcomeText"
    ]
},
...

vi app/ApppKernel.php

        ...
        // Application
        new AppBundle\AppBundle(),
        //ngadminui
        new eZ\Bundle\EzPublishLegacyBundle\EzPublishLegacyBundle( $this ),
        new Lolautruche\EzCoreExtraBundle\EzCoreExtraBundle(),
        new Netgen\Bundle\AdminUIBundle\NetgenAdminUIBundle(),
        new Netgen\Bundle\RichTextDataTypeBundle\NetgenRichTextDataTypeBundle(),
        new EzSystems\EzPlatformXmlTextFieldTypeBundle\EzSystemsEzPlatformXmlTextFieldTypeBundle(),
        ...

vi app/config/routing.yml

...
_ezpublishLegacyRoutes:
    resource: "@EzPublishLegacyBundle/Resources/config/routing.yml"
_netgen_admin_ui:
    resource: "@NetgenAdminUIBundle/Resources/config/routing.yml"

–> and here is where it crashes:

php …/composer.phar require “ezsystems/legacy-bridge” “netgen/admin-ui-bundle” “ezsystems/ezplatform-xmltext-fieldtype” “netgen/richtext-datatype-bundle”

Using version ^2.0 for ezsystems/legacy-bridge
Using version ^2.1 for netgen/admin-ui-bundle
Using version ^1.5 for ezsystems/ezplatform-xmltext-fieldtype
Using version ^1.1 for netgen/richtext-datatype-bundle
...
> Incenteev\ParameterHandler\ScriptHandler::buildParameters
Updating the "app/config/parameters.yml" file
> eZ\Bundle\EzPublishCoreBundle\Composer\ScriptHandler::clearCache
 // Clearing the cache for the dev environment with debug
 // true
PHP Fatal error:  Uncaught Symfony\Component\Debug\Exception\FatalThrowableError: Type error: Argument 1 passed to eZ\Publish\Core\MVC\Legacy\Kernel\Loader::setCLIHandler() must implement interface ezpKernelHandler, instance of eZ\Publish\Core\MVC\Legacy\Kernel\CLIHandler given, called in /srv/www/ezplatform12/ezplatform/vendor/ezsystems/legacy-bridge/mvc/Kernel/Loader.php on line 237 in /srv/www/ezplatform12/ezplatform/vendor/ezsystems/legacy-bridge/mvc/Kernel/Loader.php:255
Stack trace:
#0 /srv/www/ezplatform12/ezplatform/vendor/ezsystems/legacy-bridge/mvc/Kernel/Loader.php(237): eZ\Publish\Core\MVC\Legacy\Kernel\Loader->setCLIHandler(Object(eZ\Publish\Core\MVC\Legacy\Kernel\CLIHandler))
#1 /srv/www/ezplatform12/ezplatform/vendor/ezsystems/legacy-bridge/mvc/Kernel/Loader.php(132): eZ\Publish\Core\MVC\Legacy\Kernel\Loader->eZ\Publish\Core\MVC\Legacy\Kernel\{closure}()
#2 /srv/www/ezplatform12/ezplatform/vendor/ezsystems/legacy-bridge/bundle/Cache/LegacyCachePurger.php(54): eZ\Publish\Core\MVC\Legacy\Kernel\Loader->eZ\Publish\ in /srv/www/ezplatform12/ezplatform/vendor/ezsystems/legacy-bridge/mvc/Kernel/Loader.php on line 255
Script eZ\Bundle\EzPublishCoreBundle\Composer\ScriptHandler::clearCache handling the symfony-scripts event terminated with an exception
  [RuntimeException]
  An error occurred when executing the "'cache:clear --no-warmup'" command:
   // Clearing the cache for the dev environment with debug
   // true
  PHP Fatal error:  Uncaught Symfony\Component\Debug\Exception\FatalThrowableError: Type error: Argument 1 passed to eZ\Publish\Core\MVC\Legacy\Kernel\Loader::setCLIHandler() must implement interface ezpKernelHandler, instance of eZ\Publish\Core\MVC\Legacy\Kernel\CLIHandler given, called in /srv/www/ezplatform12/ezplatform/vendor/ezsystems/legacy-bridge/mvc/Kernel/Loader.php on line 237 in /srv/www/ezplatform12/ezplatform/vendor/ezsystems/legacy-bridge/mvc/Kernel/Loader.php:255
  Stack trace:
  #0 /srv/www/ezplatform12/ezplatform/vendor/ezsystems/legacy-bridge/mvc/Kernel/Loader.php(237): eZ\Publish\Core\MVC\Legacy\Kernel\Loader->setCLIHandler(Object(eZ\Publish\Core\MVC\Legacy\Kernel\CLIHandler))
  #1 /srv/www/ezplatform12/ezplatform/vendor/ezsystems/legacy-bridge/mvc/Kernel/Loader.php(132): eZ\Publish\Core\MVC\Legacy\Kernel\Loader->eZ\Publish\Core\MVC\Legacy\Kernel\{closure}()
  #2 /srv/www/ezplatform12/ezplatform/vendor/ezsystems/legacy-bridge/bundle/Cache/LegacyCachePurger.php(54): eZ\Publish\Core\MVC\Legacy\Kernel\Loader->eZ\Publish\ in /srv/www/ezplatform12/ezplatform/vendor/ezsystems/legacy-bridge/mvc/Kernel/Loader.php on line 255

Any idea ?


#2

@storton This is a known issue for Legacy Bridge 2.0 https://github.com/ezsystems/LegacyBridge/issues/132 and the cause is currently unknown.

However, it can easily be fixed with a workaround: https://github.com/emodric/ezplatform-legacy/commit/ab8d3e0ceebfeca31ca4dc975392689fe35f3e75

I suggest using https://github.com/emodric/ezplatform-legacy repo to start a new eZ Platform v2 + eZ Publish legacy project and then install Netgen Admin UI on top of it, because that repo has a working install providing latest eZ Platform v2 and legacy bridge 2.0.


#3

Hi,

Thank you @emodric
I have successfully installed ezPlatform v2.0 + Legacy Bridge v2.0 + Netgen Admin UI v2.1

I have not installed emodric/ezplatform-legacy, I just have followed the https://www.netgenlabs.com/Blog/How-to-start-using-Netgen-Admin-UI blog post, and between the chapter “4. add the routes for legacy…” and the chapter “5. install legacy bridge…”, I have applied the workaround you mentionned here: https://github.com/emodric/ezplatform-legacy/commit/ab8d3e0ceebfeca31ca4dc975392689fe35f3e75 (added “app/autoload.php” and modified “bin/console”)

For the chapter “5. install legacy bridge…”, I launched the following command line:

php ../composer.phar require "ezsystems/legacy-bridge" "netgen/admin-ui-bundle" "ezsystems/ezplatform-xmltext-fieldtype" "netgen/richtext-datatype-bundle"

#4

Good to hear that :slight_smile: