Viewing 13 replies - 1 through 13 (of 13 total)
  • Plugin Support Stef (a11n)

    (@erania-pinnera)

    Hi there, @briannehinchliffe,

    From your issue, it seems like there might be a problem with your theme’s hierarchy that’s causing the custom 404 page to be overruled by the Sensei course participant email template.

    Here are a few steps that you might want to consider:

    1. **Check the theme hierarchy**: Take a close look at your theme’s hierarchy to see if there’s any duplication or an incorrectly placed template, such as single-sensei_email.html, which is causing the problem with your 404 page.

    2. **Examine single-sensei_email.html template**: It’s peculiar that an email template for Sensei governs your 404 page. You may want to examine this template to see if anything in the code is redirecting the 404 page to this template.

    3. **Ensure your 404 template is correctly configured**: Make sure your 404.php template exists and is set up correctly within your theme’s file directory. On top of that, check your .htaccess file and any redirection plugins to make sure they are not accidentally redirecting 404s elsewhere.

    4. **Deactivate Plugins**: To verify if the problem lies with any plugin, you can also temporarily deactivate all of them and check if the issue persists. If the problem indeed subsides, reactivate each plugin one by one to identify which one is causing the conflict.

    5. **Switch the Theme**: Temporarily switch to a default WordPress theme, like Twenty-Twenty, and see if the 404 problem persists.

    Let me know what you find out, and we’ll take it from there if necessary.
    Thanks for sorting this out with us!

    Thread Starter Brianne

    (@briannehinchliffe)

    Thank you for your response, @erania-pinnera!

    I apologize, I should have been more detailed in my initial thread.

    1. I do not have the single-sensei_email.html template anywhere in my theme, and from what I can tell it doesn’t exist in the plugin (at least in the location indicated by Query Monitor)?
    2. I’m using Underscores so this is what my 404 template looks like: https://github.com/Automattic/_s/blob/master/404.php
    3. The only time the issue is remedied is when the Sensei LMS plugin is deactivated. Deactivating any and all other plugins does not solve the problem.
    4. I did change my theme to Twenty Twenty and Twenty Twenty Four and the 404 page works properly so I’m guessing there’s something within my theme, but I can’t imagine what? This is a brand new custom (based on underscores) theme still in development.
    5. I checked the .htaccess file and redirects and there are none that I can see, along with any functions or hooks in my theme that would be causing this.
    6. Query Monitor seems to indicate the single-sensei_email.html is a Block Template https://i.postimg.cc/Hx6FFp3J/Screenshot-2023-11-27-at-12-16-22-PM.png

    I don’t think we’re using emails in any way with Sensei LMS, and when turning off those features in the settings, it still shows the Sensei 404.

    Thanks again for any input!

    • This reply was modified 12 months ago by Brianne.
    Plugin Support Jay

    (@bluejay77)

    Hi @briannehinchliffe,

    Thank you for providing details. Let us consult with the development team and get back to you. Thanks!

    Plugin Support Jay

    (@bluejay77)

    Hi @briannehinchliffe,

    We tried reproducing the issue on our end by installing the Underscores theme on a Sensei site, but we didn’t run into the issue you’re facing. In our testing with the Underscores theme, 404 page did not result in the template theme being overridden by Sensei email templates.

    Since we couldn’t reproduce the issue, we suspect some of the customizations you’ve applied on the Underscores theme went awry, affecting Sensei templates behavior. I recommend debugging your customizations on your end.

    I did change my theme to Twenty Twenty and Twenty Twenty Four and the 404 page works properly so I’m guessing there’s something within my theme, but I can’t imagine what? This is a brand new custom (based on underscores) theme still in development.

    Unfortunately, support for customizations like this is outside the scope of our support. You may want to consider hiring someone so that you can give them direct access to the site for a far more efficient fix than we can provide here.

    You may try https://jobs.wordpress.net/ or https://jetpack.pro/ if you need help.

    All best,

    Thread Starter Brianne

    (@briannehinchliffe)

    @bluejay77

    Thanks for the information. I am actually the developer working on this project and created this entire custom theme so I don’t believe there’s anything in here that would or should make Sensei react this way. It appears now that some of the 404 pages are working, Sensei is just overriding instances of pages where there’s no content or drafted posts/pages.

    Any insight on this with that updated information? Could it possibly be related to this: Sensei_Course_Theme->add_post_type_rewrite_rules()

    For example, the page showing the weird sensei page I sent previously is a tag archive page without any posts associated with it: https://landforgood.org/blog/tag/training/

    It should be using the content-none.php template but instead I get this.

    Thanks!

    • This reply was modified 11 months, 2 weeks ago by Brianne.
    Plugin Author Dmitry Merkushin (a11n)

    (@merkushin)

    Hi @briannehinchliffe

    I think I found the issue: https://github.com/Automattic/sensei/blob/d8eaf50c4212c1d5e0fdc30c3ba2d2e786306fe3/includes/internal/emails/class-email-page-template.php#L127

    I prepared a PR with the fix. Meanwhile, you can slightly change the condition there to the following:

    if ( empty( $post_type ) || Email_Post_Type::POST_TYPE !== $post_type ) {

    I hope that helps you to temporarily fix the issue until we release it.

    Plugin Support Tamirat B. (a11n)

    (@tamirat22)

    Hello @briannehinchliffe,

    Do you have updates on the issue after the developments above? We usually close inactive threads after one week of no activity, but we want to make sure we’re all set before marking it as solved. Thanks!

    Hello,

    Is there an update on this fix yet? I have the same issue and not sure how to fix it. I have contacted pro support as I have pro version but had no reply.

    I’m not sure how to apply the temporary fix, do I need to copy class-email-page-template.php to my child theme? e.g. Child Theme/sensei/includes/internal/emails/class-email-page-template.php

    Any help appreciated. Thank you!

    Plugin Support Deric (a11n)

    (@dericleeyy)

    The fix has been merged and it will be released in the next version, 4.20.1.

    Meanwhile, you could manually modify line 127 of includes/internal/emails/class-email-page-template.php with the above fix. You would need to modify the code file directly in the plugin directory.

    Just a quick note to say that the fix for this was shipped in Sensei 4.20.1 on January 17th, 2024. Thanks so much for the report!

    Thread Starter Brianne

    (@briannehinchliffe)

    Thanks for the update everyone! Appreciate the fix – seems to have done the trick.

    Plugin Support Jay

    (@bluejay77)

    That’s great to hear, thanks for letting us know @briannehinchliffe!

    yandoos

    (@yandoos)

    Thank you very much!

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘Email Template Overrides 404 Template’ is closed to new replies.