Can not save a page
Closed this issue · 1 comments
If we create a new page from /admin/pages/
, edit and then save it, the page will be turned into a post, which is not an expected behavior.
The reason behind this is that when saving an existing page, we are actually using the route POST /admin/editor/:id/
. The request is handled by PostSaveHandler
, which sets p.IsPage = false
.
We may need to create a new general handler(e.g. ContentSaveHandler
) for POST /admin/editor/:id/
. The handler should retrieve the existing post/page by id, change the fields according to form value and save it.
In addition, by doing this we will have some duplicate code among ContentSaveHandler
, PostSaveHandler
and PageSaveHandler
. It would be great if we can extract some code from them and avoid the duplication.