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

widget iconPath() incorrect (craft3 module) #54

Closed
anchovy opened this issue Apr 24, 2018 · 5 comments · Fixed by #86
Closed

widget iconPath() incorrect (craft3 module) #54

anchovy opened this issue Apr 24, 2018 · 5 comments · Fixed by #86

Comments

@anchovy
Copy link

anchovy commented Apr 24, 2018

HI

Craft CMS 3.0.3.1 (PRO)

When creating a Craft 3 module with widgets - the iconPath in the widget is missing the prefix 'modules', as the alias is set in /modules/{module_name/src/{module_name}.php __construct() as:

Craft::setAlias('@modules/restmodule', $this->getBasePath());

The function iconPath() /modules/{module_name}/src/widgets/{widget_name).php is:
return Craft::getAlias("@{module_name}/assetbundles/fibrewidget/dist/img/{widget_name}-icon.svg");

when it should be:
return Craft::getAlias("@modules/{module_name}/assetbundles/fibrewidget/dist/img/{widget_name}-icon.svg");

@khalwat
Copy link
Collaborator

khalwat commented May 18, 2018

Thanks, I'll get this fixed up.

@MattWilcox
Copy link

Same error here in October, but a simple fix - thanks both!

@bymayo
Copy link

bymayo commented Nov 15, 2018

As well as fixing it in /modules/{module_name}/src/{module_name}.php I also had to change iconUrl variable in /modules/{module_name}/src/templates/_components/widgets/{module_name}_body.php from @{module_name} to @modules/{module_name}

@TomDeSmet
Copy link

Just had this same issue. Would be nice if this could be fixed in the pluginfactory :)
Thanks for the solution guys!

@khalwat
Copy link
Collaborator

khalwat commented Mar 29, 2020

Fixed in 0070281

@khalwat khalwat closed this as completed Mar 29, 2020
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

Successfully merging a pull request may close this issue.

5 participants