PHP 8.x
avatar chmst
chmst
11 Feb 2024

Steps to reproduce the issue

Switch on error-reporting.

Add a calendar field to component and forget the translateformat="true"
or manipulate one of the calendar fields in article.xml

Deprecated: Function strftime() is deprecated in .... \libraries\src\Form\Field\CalendarField.php on line 322

System information (as much as possible)

php 8.2

avatar chmst chmst - open - 11 Feb 2024
avatar joomla-cms-bot joomla-cms-bot - change - 11 Feb 2024
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 11 Feb 2024
avatar chmst chmst - change - 11 Feb 2024
Labels Added: PHP 8.x
Removed: No Code Attached Yet
avatar chmst chmst - unlabeled - 11 Feb 2024
avatar chmst chmst - labeled - 11 Feb 2024
avatar Quy
Quy - comment - 11 Feb 2024

See PR #41266 & #41444

avatar joomdonation joomdonation - change - 24 Feb 2024
Status New Closed
Closed_Date 0000-00-00 00:00:00 2024-02-24 09:23:39
Closed_By joomdonation
avatar joomdonation joomdonation - close - 24 Feb 2024
avatar joomdonation
joomdonation - comment - 24 Feb 2024

In the CalendarField, we have two format parameters:

To prevent warnings, you need to:

  1. Set translateformat="true"
  2. Or add filterformat attribute to your field. The value in this attribute must be equivalent to the value in format attribute. Example field:
<field
			name="created"
			type="calendar"
			label="Created Date"
			format="%Y-%m-%d"
                        filterformat="Y-m-d"
			showtime="true"
			filter="user_utc"
		/>

As the solution is there already, I'm closing this issue.

Add a Comment

Login with GitHub to post a comment