Error On Template - Question | JoomShaper

Error On Template

LG

Lorna Guttormson

Template 1 month ago

I have pitech 1.0.1 and am getting an error on J5 : PHP Warning: Undefined variable $currentDate in /home/ottawaoc/public_html/templates/pitech/html/com_content/article/default.php on line 53

This comes in this code: $isExpired = JVERSION < 4 ? (strtotime($this->item->publish_down) < strtotime(Factory::getDate())) && $this->item->publish_down != Factory::getDbo()->getNullDate() : !is_null($this->item->publish_down) && $this->item->publish_down < $currentDate;

As I have J5 it should never get to the line using $currentDate.  I understand this would be because JVERSION is J3 code - not J5.  Is there updated code for Pitech?  
0
7 Answers
Atick Eashrak Shuvo
Atick Eashrak Shuvo
Accepted Answer
Support Agent 1 month ago #214889

Hello,

Thank you for reporting this. The message you are seeing is a PHP warning, not an error. This means that the site will continue to function normally, but PHP is alerting you about a variable that is currently undefined. In contrast, an error would stop the script from running.

In your case, the warning appears because the code references $currentDate in a section that is intended for Joomla versions prior to 4. Since you are using Joomla 5, this part of the code is not applicable and can be safely ignored for now.

We do plan to refine this in a future update of Pitech to ensure full compatibility and remove such warnings. We appreciate your patience and understanding.

Best regards

0
Atick Eashrak Shuvo
Atick Eashrak Shuvo
Accepted Answer
Support Agent 1 month ago #214272

Hi there!

Thank you for bringing this to our attention, and I sincerely apologize for the inconvenience caused.

To assist you more effectively, may I kindly request temporary administrative access to your site? This will allow me to thoroughly investigate and resolve the issue for you.

Before sharing the credentials, I strongly recommend taking a complete backup of your site to ensure all data remains secure.

Looking forward to your response.

Best regards

0
LG
Lorna Guttormson
Accepted Answer
1 month ago #214553

My apologies. I thought I had replied but I obviously got distracted. Likely because we have recently implemented MFA security on administrator and super user accounts.

0
Atick Eashrak Shuvo
Atick Eashrak Shuvo
Accepted Answer
Support Agent 1 month ago #214563

Please share your site url

0
LG
Lorna Guttormson
Accepted Answer
1 month ago #214620

Sorry - sent in hidden content

0
Atick Eashrak Shuvo
Atick Eashrak Shuvo
Accepted Answer
Support Agent 1 month ago #214624

Please share the page link where you are getting the error

0
LG
Lorna Guttormson
Accepted Answer
1 month ago #214802

I don't know what page is triggering this. I am seeing it frequently in my error log. Although it is a warning it does indicate that somewhere the code is misleading. I did put the question to chatjpt and was told - by it - that JVERSION < 4 ? was not a valid test in J5 code and that it indicated the template had not been fully updated to J5. That is why I had asked if there is a newer version of the template but I wanted to ask the owners of this code rather than quoting a 'machine'. My problem is that, knowing this line is not behaving as it should - what damage is it doing?

0