Skip to content
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

Reports statistics demographic statistics fix #3628

Merged

Conversation

maltheism
Copy link
Member

This pull request Prevents console warning when going to Reports->Statistics and clicking on the Demographic Statistics when using a fresh installed version of Loris. It becomes fixed by checking if $params has been set and prevent undefined property..

See also: Bug #14381

@maltheism maltheism added Category: Bug PR or issue that aims to report or fix a bug [branch] bugfix labels May 2, 2018
@maltheism maltheism changed the base branch from major to bugfix May 2, 2018 14:19
johnsaigle
johnsaigle previously approved these changes May 2, 2018
PapillonMcGill
PapillonMcGill previously approved these changes May 7, 2018
Copy link
Contributor

@PapillonMcGill PapillonMcGill left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@driusan
Copy link
Collaborator

driusan commented May 7, 2018

Why does Travis keep not starting on our PRs..

@driusan driusan closed this May 7, 2018
@driusan driusan reopened this May 7, 2018
@ZainVirani ZainVirani added the Passed manual tests PR has been successfully tested by at least one peer label May 7, 2018
@@ -227,6 +227,11 @@ class Stats_Demographic extends \NDB_Form
$this->tpl_data['Subprojects'] = $subprojects;
$this->tpl_data['Visits'] = $Visits;

// PREVENT Undefined property Console Output
if (!isset($this->params)) {
$this->params = null;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just define params as a class variable at the start of the class and instantiate it as null so that it's always defined?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Way better solution, will do!

@maltheism maltheism dismissed stale reviews from PapillonMcGill and johnsaigle via b9e63a5 May 23, 2018 19:36
* @var array
* @access private
*/
var $params = null;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is PHP4 style. The @access private should be removed, and use the language level private/protected/public keywords instead of var in the code rather than a comment.

(This should also probably be protected, not private.)

@maltheism maltheism dismissed driusan’s stale review May 28, 2018 18:59

used language level keywords instead of var

@PapillonMcGill
Copy link
Contributor

LWBTM (look way better to me :-) )

Copy link
Collaborator

@driusan driusan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could have left the type annotation for phan, but we don't have it in most places and it's not a blocker

@driusan driusan merged commit dc9292e into aces:bugfix May 29, 2018
@ridz1208 ridz1208 added this to the 19.1.1 milestone Jun 5, 2018
@maltheism maltheism deleted the reports_statistics_demographic_statistics_fix branch May 24, 2020 02:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Bug PR or issue that aims to report or fix a bug Passed manual tests PR has been successfully tested by at least one peer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants