Skip to content

[5.x]: hasAlt sticks on "true" even when an asset removes its alt text #15762

@andrewfairlie

Description

@andrewfairlie

What happened?

Description

When you upload an image to Assets, it is hasAlt as false by default. When you add text, it goes to true, but removing the text doesn't go back to false

Steps to reproduce

  1. Upload an empty image
  2. Observe value of hasAlt
  3. Add some text to alt
  4. Observe value of hasAlt
  5. Remove all of the text
  6. Observe value of hasAlt

Expected behavior

  1. Upload an empty image
  2. Observe that hasAlt is false
  3. Add some text to alt
  4. Observe that hasAlt is true
  5. Remove all of the text
  6. Observe hasAlt is false

Actual behavior

  1. Upload an empty image
  2. Observe that hasAlt is false
  3. Add some text to alt
  4. Observe that hasAlt is true
  5. Remove all of the text
  6. Observe hasAlt is still true

Craft CMS version

5.4.4

PHP version

No response

Operating system and version

No response

Database type and version

No response

Image driver and version

No response

Installed plugins and versions

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions