Describe the bug
PageSave with a publicationState value that is not a member of PublishingMode (Published, Unpublished, HideInMenu) fails with HTTP 500 and the generic text "Exception has been thrown by the target of an invocation." The response does not say which field is wrong or which values are valid. GetPageById returns the value in lower case ("published"), and the valid value for hiding a page from menus is HideInMenu, which is easy to guess wrong (Hidden).
To Reproduce
GET /Admin/Api/GetPageById?Id=<page id>. Keep the model.
POST /Admin/Api/PageSave with that model and "publicationState":"Hidden".
- Read the page row again.
Observed (DW 10.28.11):
GetPageById -> "publicationState":"published", "published":false
PageSave {"model":{..., "publicationState":"Hidden"}}
-> HTTP 500 {"type":"https://tools.ietf.org/html/rfc9110#section-15.6.1",
"title":"Exception has been thrown by the target of an invocation.","status":500}
Page row unchanged.
On 10.28.10 "hidden" gave the same 500 and "Unpublished" saved.
Expected behavior
HTTP 400 with a validation message that names the field and the valid values, for example publicationState: 'Hidden' is not valid. Valid values: Published, Unpublished, HideInMenu.
Environment
- Dynamicweb 10.28.11 (.NET 10 hosting)
Describe the bug
PageSavewith apublicationStatevalue that is not a member ofPublishingMode(Published,Unpublished,HideInMenu) fails with HTTP 500 and the generic text "Exception has been thrown by the target of an invocation." The response does not say which field is wrong or which values are valid.GetPageByIdreturns the value in lower case ("published"), and the valid value for hiding a page from menus isHideInMenu, which is easy to guess wrong (Hidden).To Reproduce
GET /Admin/Api/GetPageById?Id=<page id>. Keep themodel.POST /Admin/Api/PageSavewith that model and"publicationState":"Hidden".Observed (DW 10.28.11):
On 10.28.10
"hidden"gave the same 500 and"Unpublished"saved.Expected behavior
HTTP 400 with a validation message that names the field and the valid values, for example
publicationState: 'Hidden' is not valid. Valid values: Published, Unpublished, HideInMenu.Environment