• Tutor LMS My profile page is trying to parse date (I’m guessing Registration date) which results in critical error on page while accessing site translated to Croatian language.

    Work fine when language is switched to English.

    Error log:

    [20-Mar-2022 15:00:11 UTC] PHP Fatal error:  Uncaught Exception: DateTime::__construct(): Failed to parse time string (Sub 29 svi 2021, 06:28:30 pm) at position 0 (S): The timezone could not be found in the database in /home/site/public_html/wp-content/plugins/tutor/classes/Utils.php:9433
    Stack trace:
    #0 /home/site/public_html/wp-content/plugins/tutor/classes/Utils.php(9433): DateTime->__construct('Sub 29 svi 2021...')
    #1 /home/site/public_html/wp-content/plugins/tutor/templates/dashboard/my-profile.php(13): TUTOR\Utils->convert_date_into_wp_timezone('Sub 29 svi 2021...')
    #2 /home/site/public_html/wp-content/plugins/tutor/includes/tutor-template-functions.php(115): include('/home/site/...')
    #3 /home/site/public_html/wp-content/plugins/tutor/templates/dashboard.php(230): tutor_load_template('dashboard.my-pr...')
    #4 /home/site/public_html/wp-includes/template-loader.php(106): include('/home/site/...')
    #5 /home/site/public_html/wp-blog-header.php(19): require_once('/home/site/...')
    #6 /home/site/public_html/index in /home/site/public_html/wp-content/plugins/tutor/classes/Utils.php on line 9433
Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support Md. Jobayer Al Mahmud

    (@jobayertuser)

    Hello @pitajpetru,

    /plugins/tutor/classes/Utils.php , here line 9417 function this convert_date_into_wp_timezone full code replace with this code

    public function convert_date_into_wp_timezone( string $date ){
        $date_format = get_option('date_format');
        $time_format = get_option('time_format');
        $date = date("{$date_format} {$time_format}",  strtotime( wp_get_current_user()->user_registered ));
        return $date;
        } (edited)
    Thread Starter pitajpetru

    (@pitajpetru)

    Can we expect this fix in official plugin as well?

    When plugin gets updated changes wont be overridden?

    Thanks!

    Thread Starter pitajpetru

    (@pitajpetru)

    Just to confirm that fix is working, updating Utils.php with code provided results in working My profile page!

    This worked well for me too (without the (edited) text).

    Thank you.

    Plugin Support Md. Jobayer Al Mahmud

    (@jobayertuser)

    Hello @pitajpetru,

    We will fix this problem with our next update so no worry. And yes glad to hear that your problem is solved.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Error loading profile page’ is closed to new replies.