• Hi,

    I get the following errors on backend, when your plugin is active since one of the latest updates: “Uncaught TypeError: document.getElementById(…) is null   <anonymous> https://www.mapsmarker.com/wp-admin/edit.php:128&#8221;

    This results in breaking maps created with our plugin “Maps Marker Pro” (and probably the functionality of other plugins too, as this error seems to occur on every backend page).

    I kindly ask you to release a fix ASAP.

    thx,

    Robert

Viewing 3 replies - 1 through 3 (of 3 total)
  • I did some further researched – the bug has been introduced with v4.1.8 with sitemap.php additions in the ga_header-function or to be more precise with the following script(s):

    <script>setTimeout(()=>{	document.getElementById("discard_content").classList.add("discard_button_outside_settings")
    document.getElementById("discard_content").classList.remove("discard_button")
    },200);</script>

    Your header code is added to each backend page and if the element with the ID discard_content is not available on that page, it breaks all other related js-depended code (like ours)!

    I´d suggest to enqueue your code on your plugins pages only and additionally check if the element exists before running the js functions above, like this e.g.

    <script>
    setTimeout(()=>{
        let discardContent = document.getElementById("discard_content");
        
        if (discardContent) {
            discardContent.classList.add("discard_button_outside_settings");
            discardContent.classList.remove("discard_button");
        }
    }, 200);
    </script>

    thx,

    Robert

    @harmr Thankyou for contacting us,

    We will track this and make the changes in future release.

    thanks – seems to have been fixed

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Console errors on backend – breaking other plugins’ is closed to new replies.