• Resolved Beee

    (@beee)


    I tried to register a user with twentyseventeen template active. It worked as expected.

    I then switched to my custom theme. I then registered another user and noticed that $template->the_errors was not shown in my template.

    After some debugging I noticed that this->is_active on line 209 from includes/class-theme-my-login-template.php is not passed. So $this is not active.

    Any idea how to solve this ? I’d like to show error notices.

Viewing 7 replies - 16 through 22 (of 22 total)
  • Thread Starter Beee

    (@beee)

    I’ve tried it and it didn’t show any message after registering.

    Plugin Author Jeff Farthing

    (@jfarthing84)

    Is this on a TML page or a widget/shortcode elsewhere?

    Thread Starter Beee

    (@beee)

    A TML Page; /login/?pending=activation

    I use the shortcode on both the register and login page.

    [theme-my-login default_action="login" show_title="0"]

    Plugin Author Jeff Farthing

    (@jfarthing84)

    Try removing the && $wp_query->is_main_query() part of the snippet I posted.

    Thread Starter Beee

    (@beee)

    I did… no luck, sorry….

    I have this website somewhere on a (protected) web location with test data.
    You’re welcome to rummage around on it, if you’re interested.

    Plugin Author Jeff Farthing

    (@jfarthing84)

    Sure. You can send info to jeff [at] jfarthing [dot] com.

    Plugin Author Jeff Farthing

    (@jfarthing84)

    So, the problem is actually because TML assumes 0 is the default instance, as it is supposed to be when the loop is properly utilized. Obviously, since that is not the case with Timber, this is not true. In your case, the default instance is 1. This may not be true if there is an instance that is loaded before your main instance, such as in the header, etc.

    By any means, since your current main instance is 1, I just modified the tml_custom_instance_setter function I gave you to trick TML into thinking the requested instance was 1, if there is no instance requested. Seems to do the trick!

    
    function tml_custom_instance_setter() {
        $tml = Theme_My_Login::get_object();
        if ( empty( $tml->request_instance ) ) {
            $tml->request_instance = 1;
        }
    }
    add_action( 'init', 'tml_custom_instance_setter' );
    
Viewing 7 replies - 16 through 22 (of 22 total)
  • The topic ‘$this->is_active not reached’ is closed to new replies.