Issue #2297989 by fgm: prevent deletion of Commerce Types with existing content

Brought across and ready to be committed .