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

[4.x & 5.x]: Error when using Live Preview after uploading an asset #14832

Closed
tommysvr opened this issue Apr 19, 2024 · 2 comments
Closed

[4.x & 5.x]: Error when using Live Preview after uploading an asset #14832

tommysvr opened this issue Apr 19, 2024 · 2 comments

Comments

@tommysvr
Copy link

tommysvr commented Apr 19, 2024

What happened?

Description

Getting an Uncaught (in promise) DOMException: Failed to set the 'value' property on 'HTMLInputElement': This input element accepts a filename, which may only be programmatically set to the empty string error when uploading an asset and then trying to preview an entry.

Steps to reproduce

  1. Click 'Upload Files' on an assets field
  2. Upload an image
  3. Click 'Preview'

Tested on a local filesystem, asset field settings are all set to the default. Dragging an image onto the field works without error.

Tested in Chrome, Safari and Firefox - the error differs slightly in each.

screenshot_2024_04_19._14.58-converted.2.mp4

Expected behavior

Live Preview loads correctly

Actual behavior

Live Preview window doesn't show, and this error is shown in the browser console:

jquery.js?v=1707205984:2 Uncaught (in promise) DOMException: Failed to set the 'value' property on 'HTMLInputElement': This input element accepts a filename, which may only be programmatically set to the empty string.
    at HTMLInputElement.<anonymous> (https://craft5.ddev.site/cpresources/624f2193/jquery.js?v=1707205984:2:67445)
    at Function.each (https://craft5.ddev.site/cpresources/624f2193/jquery.js?v=1707205984:2:3091)
    at T.fn.init.each (https://craft5.ddev.site/cpresources/624f2193/jquery.js?v=1707205984:2:1571)
    at T.fn.init.val (https://craft5.ddev.site/cpresources/624f2193/jquery.js?v=1707205984:2:67137)
    at Object.copyInputValues (https://craft5.ddev.site/cpresources/1ab53bc8/garnish.js?v=1711503619:2:112805)
    at s.constructor._getClone (https://craft5.ddev.site/cpresources/ef40e11e/cp.js?v=1713140127:2:632336)
    at s.constructor.open (https://craft5.ddev.site/cpresources/ef40e11e/cp.js?v=1713140127:2:622757)
    at s.constructor.<anonymous> (https://craft5.ddev.site/cpresources/ef40e11e/cp.js?v=1713140127:2:451105)
    at f (https://craft5.ddev.site/cpresources/ef40e11e/cp.js?v=1713140127:2:425357)
    at Generator.<anonymous> (https://craft5.ddev.site/cpresources/ef40e11e/cp.js?v=1713140127:2:426703)

Craft CMS version

Tested on 4.8.9 & 5.0.4

PHP version

8.2

Operating system and version

No response

Database type and version

MySQL 8.0

Image driver and version

No response

Installed plugins and versions

@brandonkelly
Copy link
Member

Thanks for reporting that Tommy! Fixed for the next release.

@brandonkelly
Copy link
Member

Craft 4.8.10 and 5.0.5 are out with that fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants