Closed lordrhodos closed 8 years ago
For me it worked to check if the provider key is available, but that is rather a dirty hack than a solution for the change introduced in the MediaBundle.
Resources/views/MediaAdmin/browser.html.twig - Line 47 to 59:
{% if (persistent_parameters.provider is defined) and (not persistent_parameters.provider) %}
<li class="active"><a href="{{ admin.generateUrl('browser', {'context': persistent_parameters.context, 'provider': null}|merge(ckParameters)) }}">{{ "link.all_providers"|trans({}, 'SonataMediaBundle') }}</a></li>
{% else %}
<li><a href="{{ admin.generateUrl('browser', {'context': persistent_parameters.context, 'provider': null}|merge(ckParameters)) }}">{{ "link.all_providers"|trans({}, 'SonataMediaBundle') }}</a></li>
{% endif %}
{% for provider_name in providers %}
{% if (persistent_parameters.provider is defined) and (persistent_parameters.provider == provider_name) %}
<li class="active"><a href="{{ admin.generateUrl('browser', {'context': persistent_parameters.context, 'provider': provider_name}|merge(ckParameters)) }}">{{ provider_name|trans({}, 'SonataMediaBundle') }}</a></li>
{% else %}
<li><a href="{{ admin.generateUrl('browser', {'context': persistent_parameters.context, 'provider': provider_name}|merge(ckParameters)) }}">{{ provider_name|trans({}, 'SonataMediaBundle') }}</a></li>
{% endif %}
{% endfor %}
I've integrated the latest versions of the following bundles:
and I get the following error when trying to browse the media files within the CKEditor:
Key "provider" for array with keys "context, category, hide_context" does not exist in CoopTilleulsCKEditorSonataMediaBundle:MediaAdmin:browser.html.twig at line 47
This seems to be related to a change of the MediaBundle introduced with this commit where the provider entry got removed from the parameters array.