[1.7.x] Fixed #23857 -- Fixed admin crash with "save as new" and deleting inline.

Thanks amarandon for the report.

Backport of c7a19f42030c15ad3b3475ad9a4854e10733ff74 from master