Project

General

Profile

Actions

Regression #13890

closed

Feature #13446: Upgrade PHP from 7.4 to 8.1

Captive Portal Voucher Rolls Status "Fatal error"

Added by Muhammad Waseem Ul Haq almost 2 years ago. Updated almost 2 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
Captive Portal
Target version:
Start date:
Due date:
% Done:

100%

Estimated time:
Plus Target Version:
23.01
Release Notes:
Force Exclusion
Affected Version:
2.7.0
Affected Architecture:
All

Description

When enabled & Created Vouchers under Captive Portal, Status -----> Captive Portal -----> Voucher Rolls not showing rolls instead showing Fatal Error

Crash report begins.  Anonymous machine information:

amd64
14.0-CURRENT
FreeBSD 14.0-CURRENT #0 devel-main-n255825-17d2b04a49e: Wed Jan 18 15:58:21 UTC 2023     root@freebsd:/var/jenkins/workspace/pfSense-CE-snapshots-master-main/obj/amd64/zkNuv2c1/var/jenkins/workspace/pfSense-CE-snapshots-master-main/sources/FreeBSD-src-dev

Crash report details:

PHP Errors:
[20-Jan-2023 00:01:12 Asia/Dubai] PHP Fatal error:  Uncaught ValueError: count(): Argument #2 ($mode) must be either COUNT_NORMAL or COUNT_RECURSIVE in /usr/local/www/status_captiveportal_voucher_rolls.php:95
Stack trace:
#0 /usr/local/www/status_captiveportal_voucher_rolls.php(95): count(Array, '43200')
#1 {main}
  thrown in /usr/local/www/status_captiveportal_voucher_rolls.php on line 95
[20-Jan-2023 00:06:11 Asia/Dubai] PHP Fatal error:  Uncaught ValueError: count(): Argument #2 ($mode) must be either COUNT_NORMAL or COUNT_RECURSIVE in /usr/local/www/status_captiveportal_voucher_rolls.php:95
Stack trace:
#0 /usr/local/www/status_captiveportal_voucher_rolls.php(95): count(Array, '43200')
#1 {main}
  thrown in /usr/local/www/status_captiveportal_voucher_rolls.php on line 95

No FreeBSD crash data found.

I have most recent pfsense CE Base System 2.7.0.a.20230118.1528


Files

PHP_errors.log (786 Bytes) PHP_errors.log Crash report Muhammad Waseem Ul Haq, 01/19/2023 02:14 PM
Actions #1

Updated by Jim Pingle almost 2 years ago

  • Status changed from New to Confirmed
  • Target version set to 2.7.0
  • Plus Target Version set to 23.01
Actions #2

Updated by Jim Pingle almost 2 years ago

  • Status changed from Confirmed to In Progress
  • Assignee set to Jim Pingle
Actions #3

Updated by Jim Pingle almost 2 years ago

  • Parent task set to #13446
  • Release Notes changed from Default to Force Exclusion

For some reason that page has always unnecessarily passed a second parameter to count() there and on old versions of PHP that was ignored and now it's a fatal error on PHP 8.

I removed the second parameter and the page seems to behave normally. It shows proper counts of used/active/ready vouchers for me now.

Commit coming momentarily.

Actions #4

Updated by Jim Pingle almost 2 years ago

  • Tracker changed from Bug to Regression
Actions #5

Updated by Jim Pingle almost 2 years ago

  • Status changed from In Progress to Feedback
  • % Done changed from 0 to 100
Actions #6

Updated by Muhammad Waseem Ul Haq almost 2 years ago

I updated today to most recent version 2.7.0.a.20230120.0255 and confirm that Voucher Rolls status is working perfectly now. no more errors.

Actions #7

Updated by Jim Pingle almost 2 years ago

  • Status changed from Feedback to Resolved

Thanks for testing!

The same is true here as well. I could crash multiple lab systems before the fix, and after the fix they are all working as expected.

Actions

Also available in: Atom PDF