Kunstmaan / KunstmaanBundlesCMS

An advanced yet user-friendly content management system, based on the full stack Symfony framework combined with a whole host of community bundles. It provides a full featured, multi-language CMS system with an innovative page and form assembling process, versioning, workflow, translation and media managers and much more.
https://kunstmaancms.be
MIT License
402 stars 186 forks source link

AdminBundle now dependent on NodeBundle in v5 #1820

Closed delboy1978uk closed 5 years ago

delboy1978uk commented 6 years ago

If we don't use the NodeBundle, then we get this:

Twig error - Unknown "file_exists" function.

The file_exists twig function is in NodeBundle's NodeTwigExtension.

The error appears in the _js_footer.html.twig

delboy1978uk commented 6 years ago

After creating a new Twig Extension with file_exists, I am now hitting this error:

Uncaught PHP Exception Twig_Error_Runtime: "An exception has been thrown during the rendering of a template ("None of the chained routers were able to generate route: Route 'KunstmaanNodeBundle_ckselecturl' not found")." at /home/projects/kbcmatchitpriv/data/kbcmatchitpriv/vendor/kunstmaan/bundles-cms/src/Kunstmaan/AdminBundle/Resources/views/Default/layout.html.twig line 31

The line in the template is this one:

<body {% block extraparamsinbody %}{% endblock %} class="app {% block extrabodyclasses %}{% endblock %}" data-file-browse-url="{% if nodebundleisactive is defined and nodebundleisactive %}{{ path('KunstmaanNodeBundle_ckselecturl') }}{% endif %}" etc etc >

I had to override the view and remove that if statement.

delboy1978uk commented 6 years ago

the header and sidebar also cause these errors, but mostly these can be fixed by setting:

nodebundleisactive: false

in the config.yml under twig.globals.

mostly - in the sidebar it checks if nodebundleisactive is defined, but it really needs to be if nodebundleisactive is defined and nodebundleisactive, since we just defined it! (although it must be already defined despite the nodebundle extension not configuring it? 🤔

delboy1978uk commented 6 years ago

The other one I keep coming across is entityVersionLockCheck not being defined