1.6.27 error message 1.6.27 error message
 

News:

CPG Release 1.6.28
added submissions from {406man}
cleaned up a few PHP (8.4) deprecations
fixed PHP deprecation in calendar
removed security vulnerability
(please upgrade when possible)

Main Menu

1.6.27 error message

Started by nukeworker, Yesterday at 09:12:16 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

nukeworker

[06-Mar-2026 19:19:17 UTC] PHP Deprecated:  Optional parameter $showYear declared before required parameter $only_future_dates is implicitly treated as a required parameter in /pictures/calendar.php on line 233

This PHP error occurs because of a change in PHP 8.0+ regarding how function parameters are handled. In older versions, you could place an optional parameter (one with a default value) before a required parameter, but this is now deprecated because it's logically inconsistent.

Old
function getMonthHTML($m, $y, $showYear = 1, $only_future_dates) {
New:
function getMonthHTML($m, $y, $showYear = 1, $only_future_dates = false) {
While you are at it, there are a few other spots in this specific file that will likely trigger the same or similar issues in PHP 8.x:

    Line 161 (getMonthView): The call to getMonthHTML here only passes 4 arguments. By adding the = false default above, this line will now work correctly without modification.

    Lines 304–318 (getYearHTML): These lines call getMonthHTML with only 3 arguments (missing the $only_future_dates entirely).

        Current code: $this->getMonthHTML(0 + $this->startMonth, $year, 0)

Need to add the default value to the function definition, then these calls will now automatically use false for the missing 4th argument, and the error will vanish.

ron4mac

Thank you ... fixed in soon-to-be-released v1.6.28.