Template Travus 2.0.2 (and Others?) - Question | JoomShaper

Celebrate JoomShaper's Sweet 16 with Flat 35% OFF!

Template Travus 2.0.2 (and Others?)

CG

Christian GRENIER

Template 1 month ago

Hello

Joomla 6, Template Travus .2.0.2 Warning Error (development config php) PHP Warning: $currentDate is null, file/template/travus/html/com_content/article/default.php, lg 50

Replace... : !isnull($this->item->publishdown) && $this->item->publishdown < $currentDate;

by : !isnull($this->item->publishdown) && $this->item->publishdown < Factory::getDate()->format('Y-m-d H:i:s');

Bye

0
4 Answers
Ziaul Kabir
Ziaul Kabir
Accepted Answer
Support Agent 1 month ago #223408

Hello,

Thanks for reaching out to us. Could you please share temporary administrator access to your Joomla backend? You can provide the credentials securely in the hidden content section. Also, please take a full backup of your site before we make any changes.

Once I have access, I’ll investigate further and see what’s causing the issue. Let me know once you’ve shared the details!

Best regards,

0
CG
Christian GRENIER
Accepted Answer
1 month ago #223721

Hi

No necessary to investigate: my production site is not in PHP development mode and I 've given the soluce in my first message. It's for the future versions of Joomshaper templates.

Best regards

0
Ziaul Kabir
Ziaul Kabir
Accepted Answer
Support Agent 1 month ago #223743

Hi Christian,

Thank you for your detailed feedback and for sharing the suggested fix.

We understand the issue. The warning occurs because $currentDate is not always properly initialized in development mode, which can lead to a PHP warning when comparing dates.

Your suggested approach using Factory::getDate()->format('Y-m-d H:i:s') is noted. However, in Joomla best practices, we will ensure a consistent date object is used and properly defined before comparison to avoid repeated calls and maintain performance and clarity.

We will include a proper fix in upcoming template updates to ensure compatibility across all environments and remove such warnings in future versions of the Travus template.

Thank you again for contributing to the improvement of the template.

Best regards.

0
Ziaul Kabir
Ziaul Kabir
Accepted Answer
Support Agent 1 month ago #223744

If everything is working fine now, please mark the question as complete by accepting any of our answers.

Thank you!

0