Skip to content

FIX Fix display of empty read-only fields #11716

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

Merged

Conversation

GuySartorelli
Copy link
Member

@GuySartorelli GuySartorelli commented May 2, 2025

Behat tests are also added in separate PRs linked in the issue.

Issue

$state['value'] = $this->getFormattedValue();
$state['value'] = $this->dataValue();
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Required to keep the value empty in react forms, as per CMS 5 behaviour.

In non-react forms the casting should be `HTMLFragment` and the value
should be `<i>('none')</i>`.
In react forms the value should just be the raw empty data value.
@GuySartorelli GuySartorelli force-pushed the pulls/6.0/readonly-field branch from d3629ef to d45ae46 Compare May 2, 2025 02:14
@GuySartorelli
Copy link
Member Author

CI failures are unrelated and will be handled in silverstripe/.github#395 since they're related to those merge-ups.

@GuySartorelli GuySartorelli marked this pull request as ready for review May 4, 2025 23:00
Copy link
Member

@emteknetnz emteknetnz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works well

@emteknetnz emteknetnz merged commit 85078b1 into silverstripe:6.0 May 5, 2025
10 of 13 checks passed
@emteknetnz emteknetnz deleted the pulls/6.0/readonly-field branch May 5, 2025 22:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants