In debug mode the developer can protect any CMS page from administrators user. The protected pages are still accessible from both Admin Console and Website, but:
- their status (the "Status" field) can't be changed (e.g. Approved, Declined)
- their url fragment (the "AutomaticFilename" and "Filename" fields) can't be changed
- their type (the "Type" field) can't be changed (e.g. from "Template" to "Virtual" and vice versa)
- the protection can't be removed
The protection code doesn't take into account the fact, that "Filename" field (page url fragment) is changed automatically, when "AutomaticFilename" checkbox of the page is checked. This results in page url fragment never being changed automatically, when page title is changed with disabled Debug Mode.
Move category url fragment checking/generation code after code, that ensures protected field safety.