Hello

I have joomla 4.4.3, ja_coach 1.1.6 and Guru 6.1.2

Works fine with php 8.0.30

but, as soon as I upload it to php 8.1.27 the following errors appear:

Deprecated: preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated in /home/customer/www/**********/public_html/templates/ja_coach/html/layouts/chromes/t4section.php on line 19

Deprecated: htmlspecialchars(): Passing null to parameter #1 ($string) of type string is deprecated in /home/customer/www/**********/public_html/templates/ja_coach/html/layouts/chromes/t4section.php on line 25

Deprecated: preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated in /home/customer/www/**********/public_html/templates/ja_coach/html/layouts/chromes/t4section.php on line 19

Deprecated: htmlspecialchars(): Passing null to parameter #1 ($string) of type string is deprecated in /home/customer/www/**********.com/public_html/templates/ja_coach/html/layouts/chromes/t4section.php on line 25

Deprecated: htmlspecialchars(): Passing null to parameter #1 ($string) of type string is deprecated in /home/customer/www/**********/public_html/templates/ja_coach/html/mod_guru_courses/business.php on line 23

I appreciate your help.

    Hi Joohmla,
    This is some Notice, not a bug/issue. Could you send me the admin/FTP account? we will check about it.
    Or you can help me update the following code to this files:

    File: public_html/templates/ja_coach/html/layouts/chromes/t4section.php.
    Override with this code:

    <?php
    /**
     * @package     Joomla.Site
     * @subpackage  Layout
     *
     * @copyright   Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved.
     * @license     GNU General Public License version 2 or later; see LICENSE.txt
     *
     * html5 (chosen html5 tag and font header tags)
     */
    
    defined('_JEXEC') or die;
    
    $module  = $displayData['module'];
    $params  = $displayData['params'];
    $attribs  = $displayData['attribs'];
    
    $badge = '';
    // if ($params->get('moduleclass_sfx') != null && preg_match('/badge/', $params->get('moduleclass_sfx'))) {
    //   $badge = '<span class="badge">&nbsp;</span>';
    // }
    if ($params->get('moduleclass_sfx') !== null) {
    	$badge = (preg_match('/badge/', $params->get('moduleclass_sfx'))) ? '<span class="badge">&nbsp;</span>' : '';
    }
    
    $moduleTag = htmlspecialchars($params->get('module_tag', 'div') ?? '');
    $headerTag = htmlspecialchars($params->get('header_tag', 'h4') ?? '');
    // $moduleTag      = htmlspecialchars($params->get('module_tag', 'div'));
    // $headerTag      = htmlspecialchars($params->get('header_tag', 'h4'));
    $headerClass    = $params->get('header_class');
    $bootstrapSize  = $params->get('bootstrap_size');
    $moduleClass    = !empty($bootstrapSize) ? ' span' . (int) $bootstrapSize . '' : '';
    // $moduleClassSfx = $params->get('moduleclass_sfx') != null  ? htmlspecialchars($params->get('moduleclass_sfx')) : '';
    $moduleClassSfx = htmlspecialchars($params->get('moduleclass_sfx') ?? '');
    
    
    // Sub Align
    $moduleAli = $params->get('sub-align','left');
    
    // Main Color
    $mainColor = $params->get('main-color', 'normal');
    
    // Sub Color
    $titleColor = $params->get('title-color', 'normal');
    
    // Title Space
    $titleSpace = $params->get('title-space', 'large');
    
    // Main Heading
    $moduleMain = '';
    
    if($params->get('main-heading')) {
    	$moduleMain = '<span class="main-heading mt-0 text-'.$mainColor.' h1">'.$params->get('main-heading').'</span>';
    }
    
    // Mod Description
    $moduleDesc = '';
    
    if($params->get('mod-desc')) {
    	$moduleDesc = '<div class="mod-desc lead">'.$params->get('mod-desc').'</div>';
    }
    
    // Mod Title
    $modTitle = '';
    
    if($module->showtitle != 0) {
    	$modTitle = '<'.$headerTag.' class="section-title h6 text-'.$titleColor.' '.$headerClass.'"><span>'.$module->title.'</span></'.$headerTag.'>';
    }
    
    
    if (!empty ($module->content)) {
    	$html = "<{$moduleTag} class=\"t4-mod-wrap {$moduleClassSfx} {$moduleClass}\" id=\"Mod{$module->id}\">" .
    				"<div class=\"section-inner\">" . $badge;
    
    	if ($module->showtitle != 0 || $params->get('main-heading')) {
    		$html .= "<div class=\"section-title-wrap text-{$moduleAli} space-{$titleSpace}\">{$modTitle}{$moduleMain}{$moduleDesc}</div>";
    	}
    
    	$html .= "<div class=\"section-ct\">{$module->content}</div></div></{$moduleTag}>";
    
    	echo $html;
    }

    File: /public_html/templates/ja_coach/html/mod_guru_courses/business.php. line 23:

        $moduleclass_sfx = $params->get('moduleclass_sfx') ?? ''; // Use null coalescing operator
        $moduleclass_sfx = htmlspecialchars($moduleclass_sfx, ENT_COMPAT, 'UTF-8'); // Apply htmlspecialchars after checking for null

    Hope this helps!

    The following new notices now appear:

    `Deprecated: explode(): Passing null to parameter #2 ($string) of type string is deprecated in /home/customer/www/**********/public_html/templates/ja_coach/html/com_guru/guruprograms/view_default.php on line 233

    Deprecated: strtotime(): Passing null to parameter #1 ($datetime) of type string is deprecated in /home/customer/www/**********/public_html/components/com_guru/views/guruprograms/tmpl/tabs.php on line 272

    Deprecated: explode(): Passing null to parameter #2 ($string) of type string is deprecated in /home/customer/www/**********/public_html/components/com_guru/views/guruprograms/tmpl/tabs.php on line 707

    Deprecated: strtotime(): Passing null to parameter #1 ($datetime) of type string is deprecated in /home/customer/www/**********/public_html/components/com_guru/models/guruprogram.php on line 1622

    Deprecated: strtotime(): Passing null to parameter #1 ($datetime) of type string is deprecated in /home/customer/www/**********/public_html/components/com_guru/views/guruprograms/tmpl/tabs.php on line 1115

    Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /home/customer/www/**********/public_html/components/com_guru/models/guruprogram.php on line 1658

    Deprecated: strtotime(): Passing null to parameter #1 ($datetime) of type string is deprecated in /home/customer/www/**********/public_html/components/com_guru/views/guruprograms/tmpl/tabs.php on line 272
    `

      5 days later

      Hi Joohmla,
      1/ In the /public_html/templates/ja_coach/html/com_guru/guruprograms/view_default.php on line 233, you can replace with this code:
      $selected_course_final = explode('|', $selected_course ?? '');

      About the Notices, you can provide the admin account and FTP account for further checking.

      7 days later

      The following new notices now appear:

      Deprecated: strtotime(): Passing null to parameter #1 ($datetime) of type string is deprecated in /home/customer/www/************/public_html/components/com_guru/views/guruprograms/tmpl/tabs.php on line 272

      Deprecated: explode(): Passing null to parameter #2 ($string) of type string is deprecated in /home/customer/www/************/public_html/components/com_guru/views/guruprograms/tmpl/tabs.php on line 707

      Deprecated: strtotime(): Passing null to parameter #1 ($datetime) of type string is deprecated in
      /home/customer/www/************/public_html/components/com_guru/models/guruprogram.php
      on line 1622

      Deprecated: strtotime(): Passing null to parameter #1 ($datetime) of type string is deprecated in /home/customer/www/************/public_html/components/com_guru/views/guruprograms/tmpl/tabs.php on line 1115

      Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /home/customer/www/************/public_html/components/com_guru/models/guruprogram.php on line 1658

      Deprecated: strtotime(): Passing null to parameter #1 ($datetime) of type string is deprecated in /home/customer/www/************/public_html/components/com_guru/views/guruprograms/tmpl/tabs.php on line 272

      I have had to take the site off the air due to continuous errors. Already update the login details in the header. Waiting for your help with utmost urgency.

        I have updated the login details in the header for a mirror site. Please send me specific details of the solution, so I can replicate it on the main site. Thank you so much.

          Hi Joohmla,
          I sent and notified our technical team. we will check the issue now.

          Joohmla Just for your information while the devs are investigating. The items you see are not actual errors, they are warnings that functions of PHP are no longer fully supported. This usually means that in a version of PHP or two these functions will be removed. These warnings are there to give you time to deal with the problems. Most servers/hosting is setup to not display these kinds of warnings. The site would still function normally despite them. You can usually turn off the display of these warnings in your cPanel, or you can request your hosting provider to do this. Many hosts do not like to have these kinds or warnings displayed as it can in certain cases be a security risk. Not so much with deprecation errors, but there are some warnings and actual errors that a hacker can utilise. So it is best to turn them off, and regularly check the servers logs for this kind of thing.

          Write a Reply...
          You need to Login to view replies.