Web View Issue
Issue Report: Has Web View Validation Error After Removing is_published
Description
When editing a DocType in Frappe and unchecking Has Web View, the is_published / Is Published Field configuration remains validated even after the corresponding field has been deleted from the DocType.
As a result, saving the DocType throws the following error:
Message
Is Published Field must be a valid fieldnameSteps to Reproduce
- Open any DocType that has Has Web View enabled.
- Ensure the DocType has an
is_publishedfield configured as the Is Published Field. - Uncheck Has Web View.
- Delete the
is_publishedfield from the DocType. - Save the DocType.
Actual Result
The DocType fails to save with:
Message
Is Published Field must be a valid fieldnameThis occurs even though:
Has Web Viewis unchecked.- The
is_publishedfield has been deleted. - The Is Published Field configuration is not relevant when Web View is disabled.
- The Is Published Field field/configuration may be invisible in the UI, but its value is still being validated during save.
Expected Result
When Has Web View is unchecked, Frappe should not validate the Is Published Field configuration.
Alternatively, when Has Web View is disabled, Frappe should automatically clear/reset the Is Published Field value, allowing the DocType to be saved after the is_published field is removed.
Error
Is Published Field must be a valid fieldnameAdditional Observation
The validation appears to be performed regardless of whether the Is Published Field configuration is visible in the DocType form. This can prevent saving a DocType after disabling Web View and removing the associated is_published field.
Source: frappe/frappe