For issue #11422. Added code for modal div generetion if related div is absent