Fix page veiw remove all page issue

I added a tests to verify #8512 and it turned out that the issue is not exists. So please merge this PR in case I miss something.