Deleting a page in CMS doesn't move page to trash and keeps page in some kind of limbo

Vote:
 

When we delete a page within Episerver CMS, we see the page disapearing from the page tree. When we check the trash the page is nowhere to be found. But when we search for the page in the searchbar, it still apears. And when we want to delete the pagetype from the admin panel, it tells us there are still pages with the pagetype in the CMS. When I delete a page and look in Prefix I see the following:

System.InvalidCastException: Invalid cast from 'System.Int32' to 'EPiServer.Shell.ViewComposition.ContainerType'.
  at System.Convert.DefaultToType
  at System.Web.Mvc.ValueProviderResult.ConvertSimpleType
  at System.Convert.DefaultToType
  at System.Web.Mvc.ValueProviderResult.ConvertSimpleType

How can I fix this issue?

#189380
Edited, Mar 16, 2018 16:19
Vote:
 

Do you have some events that your hooking into that are trying to cast this page to a containertype.  I have never seen this in my years so i suspect something is amiss here.  open site in debug mode or look at the episerver logs and see what the stack trace is.  that would be the first place to start.  Can you post your stack trace and see if we can't help you out.

#189398
Mar 17, 2018 17:40
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.