Fix delete post modal

Closes #2999
-Handle undefined argument being passed into the openModal
 function