Problem/Motivation

The wrapping div classes of the message that replaces a form when read only mode is enabled aren't correct for the alert messages in our theme.

We need to change class="messages warning" to class="alert alert-warning"

Proposed resolution

Add a hook to alter the form when read only mode is enabled.

In our theme we then can add THEME_readonlymode_form_alter() to make the change.

We decided to do this rather than add a setting for the message wrapper classes as we thought it would provide greater flexibility should we require to add or alter other elements in the form array when read only mode is enabled.

CommentFileSizeAuthor
readonlymode_form_alter.patch385 bytesaltcom_alan

Comments

Altcom_Alan created an issue. See original summary.

astonvictor’s picture

Status: Active » Closed (works as designed)

you can use your own form alter and execute it after all other form alters.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.