You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I paste a video URL into an Embed Hyper field and then immediately save the page with CMD+S (without waiting for the client-side actions request to hyper/fields/preview-embed complete so you have to be quick), the value is not saved as expected.
Similarly, if I delete a value from an previously saved embed field and immediately save, the old value persists.
In both cases, if I wait a few seconds before saving the expected behaviour is observed (value saved / deleted correctly)
Alas AFAICS from the Craft core source there's not currently an easy way to prevent/defer element saves. ElementEditor.js has a beforeSubmit event, but it doesn't give us a change to cancel the submit
Steps to reproduce
Create a hyper field of type "Embed" and attach it to an entry type
One the entry edit form, paste an oembed URL into the field and immediately save the page using CMD+S
Note that the new value is not saved
Craft CMS version
5.4.8
Plugin version
2.1.1
Multi-site?
Yes
Additional context
This is particularly noticeable in local dev under ddev, but also happens in conventional hosted envs too
The text was updated successfully, but these errors were encountered:
That would be correct behaviour, at least for the moment. That's really because we don't want to save just the embed URL as the value of the link, instead we need to fetch (and wait) for the full embed data to consider it a valid embed link.
I did debate this with myself at the time on whether we should record it or not, but then it means fetching the data at a later stage, which isn't ideal for performance. There's also issues with that approach when there's a failure to fetch that data, we don't want to retry over and over again.
I'm open to suggestions, but for now you need to wait until it resolves the link.
Describe the bug
If I paste a video URL into an Embed Hyper field and then immediately save the page with CMD+S (without waiting for the client-side actions request to
hyper/fields/preview-embed
complete so you have to be quick), the value is not saved as expected.Similarly, if I delete a value from an previously saved embed field and immediately save, the old value persists.
In both cases, if I wait a few seconds before saving the expected behaviour is observed (value saved / deleted correctly)
Alas AFAICS from the Craft core source there's not currently an easy way to prevent/defer element saves.
ElementEditor.js
has abeforeSubmit
event, but it doesn't give us a change to cancel the submitSteps to reproduce
Craft CMS version
5.4.8
Plugin version
2.1.1
Multi-site?
Yes
Additional context
This is particularly noticeable in local dev under ddev, but also happens in conventional hosted envs too
The text was updated successfully, but these errors were encountered: