Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CP Menu plugin icon svg path gets hardcoded #2643

Closed
juresrpcic opened this issue Mar 27, 2018 · 5 comments
Closed

CP Menu plugin icon svg path gets hardcoded #2643

juresrpcic opened this issue Mar 27, 2018 · 5 comments
Assignees

Comments

@juresrpcic
Copy link

Description

When I install SEOmatic (latest beta, but has been an issue since the beginning and had the same issue with other plugins that have custom icons) on the server, it works fine, but locally, the icon is a big mess. When examining the svg path in devtools, I see the path is still hardcoded (same as on Ubuntu 16.04 server where the plugin was installed initially).

craft-broken-icon

The devtools path for the broken svg in above screenshot is: /home/forge/productionwebsite.com/vendor/nystudio107/craft-seomatic/src/icon-mask.svg

It should be: c:\web\devwebsite.local\vendor\nystudio107\craft-seomatic\src\icon-mask.svg as this is on windows. Forward slashes would work too from my experience.

The same thing happens if I install the plugin locally first and then move to Linux - the hardcoded path is now from Windows and the nasty icon is shown on Linux.

Steps to reproduce

  1. Install a plugin with a custom icon on production (Linux)
  2. Export DB, import locally (Windows)
  3. Custom plugin SVG path is broken - the path is hardcoded and still from Linux

Additional info

  • Craft version: 3.0.0-RC16.1
  • PHP version: PHP 7.1.10 (cli) (built: Oct 4 2017 08:54:01)
  • Database driver & version: MySQL 5.7.19
  • Plugins & versions: SEOmatic 3.0.0-beta.18
@angrybrad
Copy link
Member

Is it more than just the database you move over when doing this? i.e. anything in the craft/vendor folder?

@juresrpcic
Copy link
Author

No, just the database, I install all composer dependencies separately on dev/production.

Just to be sure, I tried rm -rf vendor/ + rm composer.lock + composer install again locally (where the icon is broken currently) - doesn't help.

@angrybrad
Copy link
Member

Can you share a screenshot of the HTML you're seeing when you inspect the code. Craft just loads the SVG data to display a plugin's icon so not seeing how any absolute paths are coming into play: https://github.com/craftcms/cms/blob/develop/src/services/Plugins.php#L925

Also, I'm not able to reproduce this with the testing I've done.

capture

@juresrpcic
Copy link
Author

juresrpcic commented May 9, 2018

I think I found the culprit - the verbb/cp-nav plugin. This is a screenshot of my code when using cp-nav:

svg-issue-cpnav

And here it is when I uninstall cp-nav:

svg-issue-without-cpnav

... I'll reference this issue in cp-nav's tracker - verbb/cp-nav#47 .

@juresrpcic
Copy link
Author

Issue is resolved in cp-nav 2.0.6, thanks Josh!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants