Open jamesmacwhite opened 5 days ago
What's your exact field settings for this field? It shouldn't be showing that for any combination:
I actually think there might be a JS error that's preventing the date picker from kicking in. We populate the date picker component with a proper ISO-formatted date, but the date picker should kick in to format that visually. Can you confirm any JS errors?
Ah interesting.
I'm wondering if it is because of using the date/time events to set additional formats e.g.
Event::on(Date::class,
Date::EVENT_MODIFY_DATE_FORMAT,
static function(ModifyDateTimeFormatEvent $event) {
$event->dateFormat = 'd/m/Y';
}
);
Event::on(Date::class,
Date::EVENT_MODIFY_TIME_FORMAT,
static function(ModifyDateTimeFormatEvent $event) {
$event->timeFormat = 'g:i A';
}
);
Event::on(Date::class,
Date::EVENT_REGISTER_TIME_FORMAT_OPTIONS,
static function(RegisterDateTimeFormatOpionsEvent $event) {
$event->options[] = ['label' => '1:00 PM (g:i AM/PM)', 'value' => 'g:i A'];
}
);
I'll do some testing.
Looks like it might be related to the AssetBundle throwing a 404 when viewing the submission backend, when checking the console.
https://craftcms.com/knowledge-base/cloud-plugin-development#asset-bundles
Craft Cloud which we run our staging and live environment on publishes all asset bundles at build/deploy through the CDN path.
There is note here: Publishing one-off or ad-hoc assets at runtime is not supported on Cloud.
Not sure if this is happening anywhere?
The AssetBundle paths that are throwing a 404:
I can't see any 404 errors happening on the front-end interestingly though. The advanced date with Flatpickr is functioning on the front end, only on the CP backend does it appear to be failing due to the AssetBundle 404.
Comparing the two, there appears to be some slight path variance on the front-end compared to the back-end:
Working paths on the front end:
https://cdn.craft.cloud/d10b9526-496f-4cd6-a8ff-319f00317266/builds/9d93248e-6e98-4911-95c8-5d3855780b98/cpresources/verbb-formie-web-assets-frontend-dist/js/fields/date-picker.js?v=1731753441
https://cdn.craft.cloud/d10b9526-496f-4cd6-a8ff-319f00317266/builds/9d93248e-6e98-4911-95c8-5d3855780b98/cpresources/verbb-formie-web-assets-frontend-dist/js/formie.js?v=1731753441
CP submission backend (404):
https://cdn.craft.cloud/d10b9526-496f-4cd6-a8ff-319f00317266/builds/9d93248e-6e98-4911-95c8-5d3855780b98/cpresources/craft-web-assets-datepickeri18n-dist/datepicker-en-GB.js?v=1732318185
https://cdn.craft.cloud/d10b9526-496f-4cd6-a8ff-319f00317266/builds/9d93248e-6e98-4911-95c8-5d3855780b98/cpresources/verbb-formie-web-assets-frontend/dist/js/formie.js?v=1731753441
The differences appear to be:
verbb-formie-web-assets-frontend/dist
instead of verbb-formie-web-assets-frontend-dist
craft-web-assets-datepickeri18n-dist
instead of verbb-formie-web-assets-frontend-dist
What do we think, Craft Cloud bug?
Ah, so yes this is probably related to Craft Cloud and how they handle assets. I'll look into it further.
The formie.js
file is going to try and lazy-load other JS in, but seeing as though that 404's, it can't do that. The datepicker-en-GB.js
would be for Craft's date picker, not something we bundle with Formie.
It will be for sure. All of the asset bundles are redirected to the CDN path during the build, interesting that it happens for the CP but not front-end which I guess is the better scenario.
Would you like me to raise a support case with Craft Cloud, happy to summarise the findings for further review?
Yeah might be worthwhile, I'll investigate on my end!
Thanks Josh, will do and I'll keep you updated.
@engram-design @jamesmacwhite I've seen other reports of similar issues for Cloud. Pretty sure it is just more references to fix, like happened here.
I'll try and take a look today.
Thanks @timkelty! Let me know if you anything to help test.
I think I found the issue, it is indeed a path issue in the submission edit Twig template. I've made a PR to fix.
I don't know about the datepicker error though, as @engram-design mentioned, this is Craft's asset bundle.
Appreciate the PR! To get this early, run composer require verbb/formie:"dev-craft-5 as 3.0.12"
.
Confirming, resolved on our Craft Cloud environments.
Describe the bug
I've noticed this between Formie 1.x and Formie 3. Any date field on the CP submission view is represented as the database date/time string value, without the date picker.
Current field in Formie 1:
(Ignore LastPass it likes to get involved on most fields...)
Current field in Formie 3:
The data is correct, but from a human representation perspective, it would be nice if the submission view used the date picker in the locale set i.e. like Craft does with date fields on entries.
Steps to reproduce
Form settings
N/A
Craft CMS version
5.5.3
Plugin version
3.0.12
Multi-site?
No response
Additional context
No response