• Resolved ddmcleod

    (@ddmcleod)


    I have several websites with the TML plugin. I have created my own pages for login, lost password and password reset. Each page makes use of the [theme-my-login action=””] shortcode; they all work fine.

    After upgrading one of these websites to WP 5.2, I noticed that my login page started out with an error message. I tells me that both the email and password fields are empty. Filling out the fields and clicking submit works fine, and I can login. But even if I go back to that page, the same error messages are displayed.

    I went to one of my other websites, currently on WP 5.1.1 and verified that I do NOT have this problem on the login page. Then I upgraded to WP 5.2 and went back to the login page. Same error messages, although the form works fine.

    Just to ensure I wasn’t going insane, I went to a third website that was still on WP 5.1.1 and had TML installed. No error messages before upgrading, double error messages after upgrading to 5.2.

    I’ve tried de-activating and reactivating TML; doesn’t make any difference.

    I’m not sure what is causing this problem but it is definitely repeatable on my sites. If anyone else is seeing this and knows of a fix, I’d like to hear it.

    Thanks,

    David

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Jeff Farthing

    (@jfarthing84)

    TML hadn’t yet been updated for WP 5.2. It will be soon.

    I see that this issue is being worked on, but I wanted to mention that I am having this issue as well. Thanks in advance for addressing Jeff!

    It’s hacky as hell, but to remove the “Empty Username” and “Empty Password” errors showing when using TML on WP 5.2, make the following changes.

    In includes/class-theme-my-login-form.php

    At Line 391, replace

    		$messages = array();
    
    		foreach ( $this->errors->get_error_codes() as $code ) {

    with

                    $messages = array();
    
                    $ignored_errors = array();
                    if ( !count( $_POST ) ){
                            $ignored_errors[] = 'empty_username';
                            $ignored_errors[] = 'empty_password';
                    }
    
                    foreach ( $this->errors->get_error_codes() as $code ) {

    At Line 399, replace

    		foreach ( $this->errors->get_error_codes() as $code ) {
    
    			$severity = $this->errors->get_error_data( $code );

    with

                    foreach ( $this->errors->get_error_codes() as $code ) {
    
                            if ( in_array( $code , $ignored_errors ) )
                                    continue;
    
                            $severity = $this->errors->get_error_data( $code );

    What this basically does is tells the error rendering loop to ignore the Empty Username and Empty Password errors when there is no POST data submitted. The fields can’t be empty if they were not submitted at all!

    Hacky, but a quick way to hide the error messages pending a Plugin Patch.

    Plugin Author Jeff Farthing

    (@jfarthing84)

    Good effort. You can also apply the changes made to the plugin while waiting: https://github.com/theme-my-login/theme-my-login/commit/48967fac3108fcd36e52c47991eaf50b1ddb574e

    Didn’t see your public repo.
    I presume a Plugin Update is in the pipeline then?

    Plugin Author Jeff Farthing

    (@jfarthing84)

    @lucanos Of course. ??

    Thanks for your good communication.

    Looks like it’s not just TML. WordPress 5.2 seems to be breaking multiple plugins, and good ones, too. I just spent an hour trying to figure out what was going on with TML and another hour trying to figure out what happened with one of my Ninja Forms plugins.

    I’m not used to this many things breaking on a WordPress update. Was there something different this time?

    • This reply was modified 5 years, 6 months ago by lflier.
    Plugin Author Jeff Farthing

    (@jfarthing84)

    I wouldn’t say it “broke” TML, as log in still works. Just a minor inconvenience. ??

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Errors after WP 5.2 Upgrade’ is closed to new replies.