Template Travus 2.0.2 (and others?) - Forum | JoomShaper
Staff replied Templates

Template Travus 2.0.2 (and others?)

Asked by Christian GRENIER 5 months ago Last activity 4 months 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

4 replies

Ziaul Kabir Staff

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,

Christian GRENIER Asked this

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

Ziaul Kabir Staff

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.

Ziaul Kabir Staff

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

Thank you!

Log in to reply.