Fix errors when deleting a page and apply coding standard,
Merge pull request #6264 from openscholar/6155-fix

Fix errors when deleting a page and apply coding standard.