akeneo / pim-community-dev

[Community Development Repository] The open source Product Information Management (PIM)
http://www.akeneo.com
Other
949 stars 512 forks source link

Dashboard have hardcoded image URLs #4987

Closed jbianquetti closed 7 years ago

jbianquetti commented 7 years ago

If you install Akeneo under a subdirectory of your web server (http://localhost/akeneo/) and access the dashboard you'll find that image links are broken.

It seems that the template have hardcoded the src tag, and therefore points to wrong subdirectory on server.

I've monkey patched the file and works as expected, but needs a more general solution.

nidup commented 7 years ago

Hi @jbianquetti

Good catch!

I think that the following change could do the job,

--- a/src/Pim/Bundle/DashboardBundle/Resources/views/Widget/links.html.twig
+++ b/src/Pim/Bundle/DashboardBundle/Resources/views/Widget/links.html.twig
@@ -2,7 +2,7 @@
     <div class="span12 shortcuts text-center">
         {% for link in links %}
             <a href="{{ path(link.route) }}" class="btn shortcut" title="{{ link.label|trans }}">
-                <img src="/bundles/pimdashboard/images/{{ link.image }}"/>
+                <img src="{{ asset('bundles/pimdashboard/images/' ~ link.image) }}"/>
                 {{ link.label|trans }}
             </a>
         {% endfor %}

Are you interested to test and contribute this bug fix through a pull request on the 1.6 branch? I'll be happy to help you by reviewing and merging this PR.

If you're interested, I'll need that you read and sign our contributor agreement to merge the pull request https://www.akeneo.com/contributor-license-agreement/

Thank you!

julienanquetil commented 7 years ago

Just test it and it's working as expected !

nidup commented 7 years ago

Hi @julienanquetil !

Thank you for the pull request, we just merged it! :tada:

@jbianquetti this fix will be available in the upcoming v1.6 patch.

Cheers!