Closed anchovy closed 4 years ago
Thanks, I'll get this fixed up.
Same error here in October, but a simple fix - thanks both!
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}
Just had this same issue. Would be nice if this could be fixed in the pluginfactory :) Thanks for the solution guys!
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");