• Hello. After updating our Colormag (child) theme, I cannot longer use the “Edit Template” function of Mailpoet plugin (v. 2.13). As recommended by Mailpoet authors, I’ve activated debug mode for it, and under “WYSIJA POSSIBLE 3rd PARTY CONFLICTS” I can see the following:

        https://OURSITE/wp-content/themes/colormag/js/image-uploader.js?ver=20150309
        https://OURSITE/wp-content/themes/colormag/inc/admin/js/plugin-handle.js?ver=1

    Also, at browser’s Error Console there’s a JS error:

    Timestamp: 31/12/19 09:01:17
    Error: TypeError: element.dispatchEvent is not a function
    Source File: https://nonkilling.org/center/wp-content/plugins/wysija-newsletters/js/prototype/prototype.js?ver=2.13
    Line: 5733

    It seems to be a conflict related to ColorMag, so I wonder if someone here can give a way to fix it. Until last update of this theme, Mailpoet was working OK.

    I can see that this kind of conflict also arises between Mailpoet and other plugins, and as Mailpoet 2 is no longer mantained, I think the solution have to be to avoid the conflict from Colormag’s side.

    Thanks in advance for any help with this. We should be sending a periodical newsletter today and need to fix this urgently.

    And have a good new year, indeed! ??

    • This topic was modified 5 years, 3 months ago by Touda. Reason: removing real url
Viewing 5 replies - 1 through 5 (of 5 total)
  • @touda

    Both of the scripts which you are pointing out is required for this theme to work properly. And hence, they might not be removed. However, if those are creating issue within your site then, you can create a child theme and then, dequeue those scripts via the handles: colormag-plugin-install-helper and colormag-widget-image-upload and see if that helps?
    And regarding the console error which you are pointing out, is not from the theme, instead seems to be via the plugin as we see from the error message. So, for that, please consult once with the respective plugin developer.

    Thanks.

    Thread Starter Touda

    (@touda)

    Hi, Nitu. Thanks for your answer.

    What we are using is a child theme, already, as I noted from the begining, but I don’t know how to “dequeue” (?) those scripts that are loaded in the edit template page of Mailpoet. Can you tell me how to do it?

    If you take a look at that page I was pointing out as an example of other conflict (in this case re a second plugin, not a theme), the key to solve was to only load scripts in the pages that are needed, in order to avoid conflicts, via a conditional code to load them. In our case, this page of Mailpoet dashboard, has loaded

    <script src='https://nonkilling.org/center/wp-content/themes/colormag/js/image-uploader.js?ver=20150309'></script>

    and also

    <script>
    var colormag_plugin_helper = {"activating":"Activating "};
    var colormag_redirect_demo_page = {"uri":"https:\/\/nonkilling.org\/center\/wp-admin\/themes.php?page=demo-importer&browse=all&colormag-hide-notice=welcome","btn_text":"Processing...","nonce":"df59773639"};
    </script>

    and

    <script src='https://nonkilling.org/center/wp-content/themes/colormag/inc/admin/js/plugin-handle.js?ver=1'></script>
    <script>

    Which I think are not needed there at all.

    You say that the JS error is not “from the theme”, and that is obvious, but in plugin-plugin or plugin-theme conflicts the origin of an error gives no clue about who’s to blame, but only which is loaded last or executed first, as far as I know. The second script can be perfectly coded, but a previously loaded script can cause an error from the second one. This can be the reason: “In short, never hook directly to admin_head to include your scripts. Instead, create your own custom hook: myplugin_admin_head.” (From How plugin and theme developers can avoid conflicts at Mailpoet Knowledge Base.)

    In that referrered analogous case GeoDirectory Code plugin developers were kind to re-code their script so it only loads when and where needed avoiding interference with other script at pages not related with it.

    Won’t be useful to do so, also in Colormag theme script and not load them at dashboard pages at all?

    Hope you can help. Thanks again!

    Thread Starter Touda

    (@touda)

    Well, I learned how to dequeue those scripts, but the problem is still there ??

    The Edit Template page of Mailpoet is not working properly: tools tabs are not showing and template is not editable ??

    The JS error is still there:

    Timestamp: 02/01/20 10:34:40
    Error: TypeError: element.dispatchEvent is not a function
    Source File: https://nonkilling.org/center/wp-content/plugins/wysija-newsletters/js/prototype/prototype.js?ver=2.13
    Line: 5733

    Could it be an issue with loaded styles??

    • This reply was modified 5 years, 2 months ago by Touda.
    • This reply was modified 5 years, 2 months ago by Touda.

    @touda

    Well, they are needed within the theme for the demo import process on each of the admin dashboard page of your site. And are you sure that those scripts are dequeued within your site? Can you once properly check and confirm on it? Also, we will have a look on our development environment and if found the same issue then, we will check on it in detail and try to resolve it as soon as possible. So, thank you for your patience on it.

    Thanks.

    Thread Starter Touda

    (@touda)

    And are you sure that those scripts are dequeued within your site? Can you once properly check and confirm on it?

    Yes, I’ve loaded that Edit Template page of Mailpoet section of the dashboard (https://OURSITE/wp-admin/admin.php?page=wysija_campaigns&id=IDNUMBEROFTHENEWSLETTER&action=editTemplate), taken a look at the source code and those .js are no longer present.

    I’ve just check it twice before posting this answer. Thank you very much for your help.

    (I’ve also posted about this conflict at Mailpoet’s forum, but I got still no answer.)

    Also, we will have a look on our development environment and if found the same issue then, we will check on it in detail and try to resolve it as soon as possible.

    Remember that I’m using Mailpoet 2.13. You may find difficult to download this version, as they are promoting Mailpoet 3 and all 2.* version are now unmantained.

    • This reply was modified 5 years, 2 months ago by Touda.
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Conflict with Mailpoet (v. 2) plugin’ is closed to new replies.