Forum

Welcome to ProjeQtOr new Forum. We migrated old forum to the new website.
You will find all your posts here, with your usual account.
Just one point : you’ll have to reinitialize your password. Use “Lost password” feature.

[PHP8] Depreciation...
 
Notifications
Clear all

[PHP8] Depreciation notice on require param after optional param

4 Posts
2 Users
0 Reactions
1,936 Views
(@bbalet)
Posts: 10
Active Member
Topic starter
 
[#7158]

In view/objectDetail.php, you can find this odd signature with an optional paramater that is not placed at the end :
function drawStructureFromObject($obj, $refresh=false, $way, $item) {

This is depreciated in PHP8 and will cause an error with the following versions. After examining all the callers, I suggest to remove the optionnality:

function drawStructureFromObject($obj, $refresh, $way, $item) {

 


 
Posted : 05 Jan 2021 13H08
(@bbalet)
Posts: 10
Active Member
Topic starter
 

Same error, same fix for:

function drawSubscriptionsList($obj, $refresh=false, $limitToActive) {
function drawVersionStructureFromObjectAsset($obj, $refresh=false, $way, $item) {
function drawVersionStructureFromObject($obj, $refresh=false, $way, $item) {


 
Posted : 05 Jan 2021 13H34
babynus
(@babynus)
Posts: 14966
Main Contributor Admin
 

Hi,

Yes, I started to test under PHP8, wich requires (weel it's only deprecated message yet) that optional parameter cannot be followed by required one.
We fixed with different, but systematic solution : after optional parameter, existing required parameters are set option with null value

function drawStructureFromObject($obj, $refresh=false, $way=null, $item=null) {

This will work in all cases as these parameters are always set (they were required).


 
Posted : 06 Jan 2021 2H30
babynus
(@babynus)
Posts: 14966
Main Contributor Admin
 

function drawSubscriptionsList($obj, $refresh=false, $limitToActive) {
function drawVersionStructureFromObjectAsset($obj, $refresh=false, $way, $item) {
function drawVersionStructureFromObject($obj, $refresh=false, $way, $item) {
Yes, I already found these errors during first PHP8 testing, and few others in tcpdt_fonts.php, tcpdf_static.php, EmployeeManagerMain.php, RequestHandler.php, PlannningElementMain.php, ImputationLine.php and projeqtor.php


 
Posted : 06 Jan 2021 2H34
Share:

Scroll to Top