• I noticed you could no longer click on the “Generate password” button after activating the plugin. In the browser console I then noticed this error:

    Uncaught TypeError: Cannot read property 'model' of undefined

    The reason of this conflict is because the code for the the media model (function ilove_pdf_media_selector_print_scripts in admin/watermark-settings.php) is loaded with the admin_footer hook and therefore also executed on other admin pages.

    A quick fix for this is adding a check to see if we are on the settings page and in the watermark tab. You could additionally also check to see if the option for the watermark image has been set.

    Possible solution:
    https://gist.github.com/jeffreyvr/45bb897e3b30979ad6548e50776ea3a7

  • The topic ‘Javascript error and solution’ is closed to new replies.