E-Newsletter Activates Default Theme and Removes Widgets

Hi,

Overall I am very pleased with e-Newsletter. There is just one small bug that is very annoying.

I wanted to add my custom theme. I did this by copying one of the existing themes and renaming both the copied folder and the name inside the style.css file. When I am editing a Newsletter and switch to this theme everything is fine. The problem is when I save and then later edit a Newsletter with this theme. It always deactivates my WordPress theme and switches to the default theme. Just to be sure, I tried making a custom theme without changing anything except the name. I always get this error.

After much trying I finally decided to just edit one of the existing themes and that worked great. So I edited the Handwritten theme and got it working. However, the problem still comes back at times (only approximately one in fifty times). And it only ever happens when I click on "Edit" on the Newsletters screen.

I'm not sure if this is an error with the plugin or WordPress but the strange thing is that it only happens sometimes, it's not consistent. With custom themes it happens always, however.

It's be great if you could get one of the developers to look at it because I've seen some similar forum posts that report the same problem with the default theme being activated. I've halfway fixed the problem by changing the default theme to the theme I want, but the problem is that all widgets are deactivated whenever this happens.

Thank you for your help!
Jonas

  • sanjon
    • WPMU DEV Initiate

    Hi Vaughan,

    I've tried both folders and both times the theme was recognized by the e-newsletter plugin. I was even able to switch to the theme within the customizer view without problems.

    But once I save a newsletter with this new theme and then later click on the "edit" button, it always gives an error message and switches to the default WordPress theme (twentyfourteen). So my guess is that it must be something to do with loading the customizer.

    Thank you for looking into this!

  • sanjon
    • WPMU DEV Initiate

    Hi,

    I just found another thread that explains the problem more clearly: https://premium.wpmudev.org/forums/topic/enewsletter-deactivating-my-site-theme

    It's the exact same problem I have. It happens everytime with custom (E-Newsletter) themes and sometimes with default (E-Newsletter) themes, where I've just edited the HTML template, nothing else.

    I've set my default (WordPress) theme to the one I am using for the site so at least my site doesn't crash completely. The only issue is that the widgets are disabled.

    Thanks for your help.

  • Jack Kitterhing
    • Code Norris

    Hi there @sanjon,

    Hope you're well today and thanks for your question and the additional information.

    I've done some testing on a few of my own sites and haven't been able to replicate this.

    How many plugins in total do you active? Do you have any caching or security plugins enabled?

    Also do you have any server side caching or database caching, such as MemCache or APC?

    Please advise. :slight_smile:

    Thank you!

    Kind Regards
    Jack.

  • sanjon
    • WPMU DEV Initiate

    Here is a list of all the plugins I have installed and activated (there are no caching or security plugins):

    - Default Media Uploader View
    - E-Newsletter
    - Easing Slider "Lite"
    - Google Analytics +
    - Google Maps
    - Image Watermark
    - mqTranslate
    - WP-Mail-SMTP

    I can't really disable the plugins since the website is already live.

    I've also noticed that the error only really appears when I open multiple newsletters at the same time. I can live with that small bug, I just thought there might be a fix. For example, do you think it is possible to prevent WordPress from deactivating widgets when it switches to the default theme? If that was possible then the bug wouldn't affect my site.

  • Jack Kitterhing
    • Code Norris

    Hi there @sanjon,

    Hope you're well today! :slight_smile:

    WordPress shouldn't auto deactivate the widgets on theme switching, Would it be possible to replicate your site setup on another site?

    I believe this could be your theme, If you start with say the twenty fourteen theme and then switch themes does it still remove the widgets from the sidebar?

    Thank you!

    Kind Regards
    Jack.

  • sanjon
    • WPMU DEV Initiate

    Hi,

    Thank you, I'm doing fine.

    When I switch themes manually the widgets are not deactivated. It's just when WordPress switches to the default theme by itself, which seems to be caused by this plugin. (See the video in the forum thread that I linked earlier and you'll see what I mean). This default theme switch does two things:

    1. It switches to the default theme (it was twentyfourteen but I chaged the default theme constant to the theme that I am using, so this is not a problem).

    2. It removes the widgets from the widget area and I have to re-insert them whenever this happens.

  • Jack Kitterhing
    • Code Norris

    Hi there @sanjon,

    Hope you're having a great weekend! :slight_smile:

    Thanks for the additional information, I've reviewed the other thread along with the video and having being able to replicate.

    Though as this is both you and another member having the same issue, I've flagged the developer of E-Newsletter for his valuable input here.

    Appreciate your patience on this.

    Thanks!

    Kind Regards
    Jack.

  • Maniu
    • Developer

    Hey @sanjon

    I think the problem might be exactly caused by opening multiple tabs of newsletters. Is it all fine when you open one at the time?

    Due to the unique way WP customizer has been used, some workarounds had to be applied in code and it seems to be related.

    Do you have another WP installation at the same server that we could use for testing?

    Thanks,
    Maniu

  • sanjon
    • WPMU DEV Initiate

    Hello Maniu,

    I can tell you know what you're talking about because the problem only ever occurred when I opened multiple newsletters. If that's the problem then I can certainly live with it. I just wanted to update some things for all newsletters when I noticed it.

    How is it with different users editing separate newsletters? Would a problem occur then? And what happens if they edit the same newsletter?

    Thank you very much for your help!

  • Maniu
    • Developer

    Hello,

    I understand that editing many newsletters at once can come in handy sometimes but unfortunately i don't see solution for it right now. Using core WP features can lead to cool functionality but sometimes it may also cause issues. Maybe in future it will be possible to fix it with next WP update.

    Editing multiple newsletters by multiple users should be fine as long as one user is editing one newsletter.
    Editing same newsletter by multiple users should work but users would be overwriting each others work.

    Thanks,
    Maniu

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.