3

I have big problem after composer update,

Acctualy I am working with sylius e-commerce on symfony2 (2.8.3).

And few moments ago I did composer update and my symfony version updated to 2.8.4-dev from 2.8.3 and my sylius e-commerce project is not working anymore, acctualy I am getting this error message:

An exception has been thrown during the rendering of a template ("Doctrine is not available.") in SyliusWebBundle:Frontend:layout.html.twig at line 97.

SYLIUS VERSION IS v0.17.0

Please help me..

Thanks

  • 1
    Im having the same issue, my composer has symfony set at 2.8.3 but updated itself to 2.8.4-dev today. also using sylius. – mr12086 Apr 12 '16 at 15:48

1 Answers1

0

It's a known bug in the Sylius 0.17 release (one that I'll personally be looking to fix in the next few days).

In the meantime, you can fix it by manually enabling Doctrine PHPCR:

app/config/config.yml:

cmf_core:
    persistence:
        phpcr:
            enabled: true

Another temporary fix is to open src/Sylius/Bundle/WebBundle/Resources/Frontend/layout.html.twig and remove {% block slideshow_sidebar %}{% endblock %} and the next ~16 lines up to but not including {% endblock %}.

         {# delete these lines only #}
            {% block slideshow_sidebar %}{% endblock %}

            {% set links = cmf_children(cmf_find('/cms/pages')) %}
            {% if links is not empty %}
            <h2>{{ 'sylius.ui.links'|trans }}</h2>
            <ul>
              {% for link in links %}
                {% if cmf_is_linkable(link) %}
                    <li>
                      <a href="{{ path(link) }}">{{ link.title|striptags }}</a>
                    </li>
                {% endif %}
              {% endfor %}
            </ul>
            {% endif %}
Adam Elsodaney
  • 7,722
  • 6
  • 39
  • 65
  • I'd rather not install symfony-cmf as I am not using it myself, is it really necessary for Sylius?.. seems Sylius is tied to too many dependencies. – mr12086 Apr 12 '16 at 15:52
  • it will get installed anyway (via Composer) but you can avoid using it by editing the homepage template, or overriding it - see the updated answer. – Adam Elsodaney Apr 12 '16 at 15:58
  • @AdamElsodaney mate, thanks a lot for your advices and solutions, temporary solution worked for me, but I want to ask you, in a case I want to you solution number 1 (Edit app/config/config.yml file), where should I put that block of code? "cmf_core: persistence: phpcr: enabled: true" –  Apr 13 '16 at 07:18
  • @billy_56 no worries. yeah you can put it anywhere you like, at the bottom of the file is the more obvious choice, unless there is already a config for `cmf_core` but I doubt it – Adam Elsodaney Apr 13 '16 at 08:16
  • @AdamElsodaney thanks a lot mate, have a nice day! :) –  Apr 13 '16 at 08:31