-
Notifications
You must be signed in to change notification settings - Fork 60
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
Freeform formatting template resources are not Craft Cloud compatible #1660
Comments
Thank you for bringing this to our attention @timkelty. We'll look into this and address it shortly. 🙂 |
This should be resolved now in Freeform 5.8 🙂 |
Sorry about this @timkelty. We'll look into it shortly. |
@gustavs-gutmanis The conversion to asset bundles makes them publishable, which is great. What's happening now is an issue with alias resolution. Asset bundle classes are instantiated and published in isolation, meaning the The easiest fix is to always use the automatic alias the plugin installer adds for you based on your, in this case // @freeform-formatting-templates is defined in \Solspace\Freeform\Freeform::init, which isn't called when `craft cloud/asset-bundles/publish` publishes asset bundles to the CDN
// $this->sourcePath = '@freeform-formatting-templates/flexbox';
// So, if we want to use an alias, we can use the automatically registered one:
$this->sourcePath = '@Solspace/Freeform/templates/_templates/formatting/flexbox'; |
…late resources for Craft Cloud compatibility (#1683)
What happened?
Craft Cloud requires that front-end resources be defined as asset bundles, so it can publish them to the CDN at deploy time.
Freeform ships with Formatting Templates that attempt to load CSS/JS via
view.assetManager.publishedUrl
, but because those are never defined as Asset Bundles, they are never copied to the CDN: https://github.com/solspace/craft-freeform/blob/v5/packages/plugin/src/templates/_templates/formatting/flexbox/index.twig#L2-L3The result is a URL to something like: https://cdn.craft.cloud/{envId}/builds/{buildId}/cpresources/Solspace-Freeform-templates-_templates-formatting-flexbox/_main.css which will be a 404.
The most straightforward way to address this would probably be to move the referenced assets to
packages/plugin/src/Resources/{css,js}
and a corresponding \Solspace\Freeform\Resources\Bundles\TemplateBundle`.Errors and Stack Trace (if available)
No response
How can we reproduce this?
Render a form using a formatting template that includes resources, eg
flexbox
.Freeform Edition
Pro
Freeform Version
5.6.8
Craft Version
5.4.9
When did this issue start?
No response
Previous Freeform Version
No response
The text was updated successfully, but these errors were encountered: