Page 1 of 1

Use of undefined constant DATE_FORMAT_LC3

Posted: 22 Apr 2020, 13:14
by plamen
Hi Jan,
Recently my site is showing above file to download:

Code: Select all

Warning: Use of undefined constant DATE_FORMAT_LC3 - assumed 'DATE_FORMAT_LC3' (this will throw an Error in a future version of PHP) in .../administrator/components/com_phocadownload/libraries/phocadownload/file/file.php on line 227
DATE_FORMAT_LC3 exists in language file, also tried to add it as an overridden constant to no avail.
All languages reverted to English, all caches cleared, but same Warning label.
J 3.9.18
PD 3.2.0
PHP Version 7.2.29

Any ideas?

Re: Use of undefined constant DATE_FORMAT_LC3

Posted: 22 Apr 2020, 15:36
by plamen
Added comment:
Substituting "DATE_FORMAT_LC3" with "d F Y" at line 227 in the subject file eliminates the warning.
Seem like this constant is not defined inside Joomla.

Re: Use of undefined constant DATE_FORMAT_LC3

Posted: 22 Apr 2020, 15:48
by christine
Hi plamen,

check again your PD version: https://www.phoca.cz/download/category/ ... -component. Thank you.
You should use PHP 7.3.

Kind regards
Christine

Re: Use of undefined constant DATE_FORMAT_LC3

Posted: 22 Apr 2020, 22:15
by plamen
Your version: 3.2.0 - that's reported.
PHP 7.3 is recommended, but 5.3.10 is minimum for Joomla 3.9, why I have to use 7.3?

Re: Use of undefined constant DATE_FORMAT_LC3

Posted: 23 Apr 2020, 12:24
by Jan
Hi, thank you for the info, there is an error, which will be fixed in next version.

For now you can do a quick fix:

FROM:

Code: Select all

public static function getFileTime($filename, $function, $format = DATE_FORMAT_LC3) {
TO:

Code: Select all

public static function getFileTime($filename, $function, $format = 'DATE_FORMAT_LC3') {
		
		$format = JText::_($format);
on line 227 in:
administrator/components/com_phocadownload/libraries/phocadownload/file/file.php

Thank you,
Jan

Re: Use of undefined constant DATE_FORMAT_LC3

Posted: 23 Apr 2020, 16:02
by plamen
Thank you, fixed.
Waiting for update as well.

Re: Use of undefined constant DATE_FORMAT_LC3

Posted: 23 Apr 2020, 17:09
by Jan
Ok, thank you for info.

Jan

Re: Use of undefined constant DATE_FORMAT_LC3

Posted: 24 Oct 2020, 16:58
by Jan
Hi, should be OK in version 3.2.1:
https://www.phoca.cz/news/1098-phoca-do ... 1-released

Jan