Fix php error when no modals are on the page.