-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix PHP warnings #431
Comments
jaragunde
added a commit
that referenced
this issue
Dec 1, 2018
There were several errors like this in the logs: PHP Warning: Use of undefined constant header - assumed 'header' (this will throw an Error in a future version of PHP) in /var/www/html/phpreport/web/services/getProjectUserWeeklyHoursReportJsonService.php on line 168
jaragunde
added a commit
that referenced
this issue
Dec 1, 2018
There were several errors like this in the logs: PHP Notice: Undefined index: dateFormat in /var/www/html/phpreport/web/services/getProjectUserWeeklyHoursReportJsonService.php on line 41 Used the new PHP7 null coalesce operator to assign default values in those cases that printed a warning. Also removed $login which was never used in these services.
jaragunde
added a commit
that referenced
this issue
Dec 1, 2018
Fixes this warning which popped up several times: PHP Notice: Undefined variable: login in /var/www/html/phpreport/web/viewProjectDetails.php on line 345 The login parameter was ignored by the service, and the local $login var didn't even have a value.
jaragunde
added a commit
that referenced
this issue
Dec 1, 2018
jaragunde
added a commit
that referenced
this issue
Dec 1, 2018
The output of this value was always 0, and it was also generating some php warnings: PHP Notice: Undefined variable: report2 in /var/www/html/phpreport/web/services/getProjectUserCustomerReportJsonService.php on line 135 PHP Warning: count(): Parameter must be an array or an object that implements Countable in /var/www/html/phpreport/web/services/getProjectUserCustomerReportJsonService.php on line 135
jaragunde
added a commit
that referenced
this issue
Dec 1, 2018
Using is_null on an array element evaluates if the contents of that position in the array is null, assuming the element exists, and emits a warning if it doesn't. Using isset checks the existence of that element, which is what we actually want. Fixes warnings like this, logged from many phpreport pages: PHP Notice: Undefined index: in /var/www/html/phpreport/model/dao/TaskDAO/PostgreSQLTaskDAO.php on line 409
jaragunde
added a commit
that referenced
this issue
Dec 17, 2018
(Merge pull request #424 from Igalia/php-warnings-project-details)
A number of patches addressing this kind of issues was merged in PR #424:
|
jaragunde
added a commit
that referenced
this issue
Jan 14, 2019
Fixes the following errors: Undefined offset: 0 in /var/www/html/phpreport/model/dao/UserGoalDAO/PostgreSQLUserGoalDAO.php on line 224 Undefined offset: 0 in /var/www/html/phpreport/model/dao/ExtraHourDAO/PostgreSQLExtraHourDAO.php on line 126 Undefined variable: rows in /var/www/html/phpreport/model/dao/TaskDAO/PostgreSQLTaskDAO.php on line 461 Undefined variable: result in /var/www/html/phpreport/model/dao/TaskDAO/PostgreSQLTaskDAO.php on line 645 Undefined variable: string in /var/www/html/phpreport/web/services/createTasksService.php on line 234 sizeof(): Parameter must be an array or an object that implements Countable in /var/www/html/phpreport/model/dao/TaskDAO/PostgreSQLTaskDAO.php on line 669
jaragunde
added a commit
that referenced
this issue
Jan 14, 2019
Fixes errors like: Undefined index: sid in /var/www/html/phpreport/web/services/getUserTemplatesService.php on line 26
jaragunde
added a commit
that referenced
this issue
Jan 14, 2019
Fixes the following errors: Undefined offset: 0 in /var/www/html/phpreport/model/dao/UserGoalDAO/PostgreSQLUserGoalDAO.php on line 224 Undefined offset: 0 in /var/www/html/phpreport/model/dao/ExtraHourDAO/PostgreSQLExtraHourDAO.php on line 126 Undefined variable: rows in /var/www/html/phpreport/model/dao/TaskDAO/PostgreSQLTaskDAO.php on line 461 Undefined variable: result in /var/www/html/phpreport/model/dao/TaskDAO/PostgreSQLTaskDAO.php on line 645 Undefined variable: string in /var/www/html/phpreport/web/services/createTasksService.php on line 234 sizeof(): Parameter must be an array or an object that implements Countable in /var/www/html/phpreport/model/dao/TaskDAO/PostgreSQLTaskDAO.php on line 669
jaragunde
added a commit
that referenced
this issue
Feb 25, 2019
(Merge pull request #438 from Igalia/i431-php-warnings-tasks-page)
More fixes from PR #438:
|
jaragunde
added a commit
that referenced
this issue
May 5, 2021
jaragunde
added a commit
that referenced
this issue
May 5, 2021
Also fix indentation of surrounding code.
jaragunde
added a commit
that referenced
this issue
May 5, 2021
Also fix indentation of surrounding code.
jaragunde
added a commit
that referenced
this issue
May 5, 2021
jaragunde
added a commit
that referenced
this issue
May 5, 2021
Also fix indentation of surrounding code.
jaragunde
added a commit
that referenced
this issue
May 20, 2021
Merge pull request #497 from Igalia/i431-php-warnings
More fixes from PR #497:
|
anarute
pushed a commit
to anarute/phpreport
that referenced
this issue
Jul 27, 2021
anarute
pushed a commit
to anarute/phpreport
that referenced
this issue
Jul 27, 2021
Also fix indentation of surrounding code.
anarute
added a commit
to anarute/phpreport
that referenced
this issue
Jul 27, 2021
This fix a few warnings like
jaragunde
added a commit
that referenced
this issue
Jan 17, 2022
jaragunde
added a commit
that referenced
this issue
Jan 25, 2022
Fixes: * Undefined index: sid, uid, active, login, order * Undefined variable: string
jaragunde
added a commit
that referenced
this issue
Jan 25, 2022
jaragunde
added a commit
that referenced
this issue
Jan 25, 2022
Fixes several of each type: * Use of undefined constant. * Undefined variable. * Undefined index. * Invalid argument supplied for foreach(). * count(): Parameter must be an array.
jaragunde
added a commit
that referenced
this issue
Jan 25, 2022
Fixes: * Undefined variable: createTasks * count(): Parameter must be an array
jaragunde
added a commit
that referenced
this issue
Jan 25, 2022
jaragunde
added a commit
that referenced
this issue
Jan 25, 2022
Fixes several of each type: * Use of undefined constant. * Undefined variable. * Undefined index. * Invalid argument supplied for foreach(). * count(): Parameter must be an array.
jaragunde
added a commit
that referenced
this issue
Jan 25, 2022
Fixes: * Undefined variable: createTasks * count(): Parameter must be an array
jaragunde
added a commit
that referenced
this issue
Jan 25, 2022
Reviewed in #555:
|
jaragunde
added a commit
that referenced
this issue
Feb 7, 2022
Fixes: * Undefined variable: string * Undefined index: sid
Reviewed in PR #560:
|
jaragunde
added a commit
that referenced
this issue
Apr 7, 2022
Fixes: * Undefined index: sid * Undefined variable: string
jaragunde
added a commit
that referenced
this issue
Apr 7, 2022
Merged in PR #575:
Also, recently pushed to main:
|
jaragunde
added a commit
that referenced
this issue
Apr 19, 2022
* Undefined index: format * Undefined index: pid * Undefined index: sid (twice) * Undefined index: PHP_AUTH_USER * Undefined offset: 0 (twice) * Undefined variable: results (twice) * Undefined variable: records (twice) * Undefined variable: rows * Undefined variable: stories * Undefined variable: userLogin * Undefined variable: userPassword And other warnings derived from the above.
jaragunde
added a commit
that referenced
this issue
Apr 19, 2022
* Undefined index: format * Undefined index: pid * Undefined index: sid (twice) * Undefined index: PHP_AUTH_USER * Undefined offset: 0 (twice) * Undefined variable: results (twice) * Undefined variable: records (twice) * Undefined variable: rows * Undefined variable: stories * Undefined variable: userLogin * Undefined variable: userPassword And other warnings derived from the above.
Landed in PR #578:
|
Merged in PR #600:
|
jaragunde
added a commit
that referenced
this issue
Jan 11, 2023
Merged in PR #606:
|
jaragunde
added a commit
that referenced
this issue
Mar 8, 2023
This warning has become an error in PHP 8. We also remove some unused code.
Merged in PR #621:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There is a number of PHP warnings/notices in the web server log. These are just some of them:
They should be checked one by one and addressed.
The text was updated successfully, but these errors were encountered: