Fatal error in lib/form/elements/ratings.php

Bug #1574716 reported by Darren James Harkness
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
High
Unassigned
16.04
Fix Released
High
Unassigned
16.10
Fix Released
High
Unassigned

Bug Description

When loading a portfolio in 16.04RC2, a white screen is encountered, and the following is written to the error log. This also occurred in 16.04RC1.

[25-Apr-2016 09:26:36] PHP Fatal error: Can't use function return value in write context in /home/darren/public_html/m1604rc2/lib/form/elements/ratings.php on line 71
[25-Apr-2016 09:26:36] PHP Stack trace:
[25-Apr-2016 09:26:36] PHP 1. {main}() /home/darren/public_html/m1604rc2/view/view.php:0
[25-Apr-2016 09:26:36] PHP 2. pieform() /home/darren/public_html/m1604rc2/view/view.php:221
[25-Apr-2016 09:26:36] PHP 3. Pieform::process() /home/darren/public_html/m1604rc2/lib/mahara.php:4493
[25-Apr-2016 09:26:36] PHP 4. Pieform->__construct() /home/darren/public_html/m1604rc2/lib/pieforms/pieform.php:161
[25-Apr-2016 09:26:36] PHP 5. Pieform->include_plugin() /home/darren/public_html/m1604rc2/lib/pieforms/pieform.php:406

This occurs on RHEL6, with PHP 5.3.3

[darren@swiftly m1604rc2]$ php -v
PHP 5.3.3 (cli) (built: Jul 3 2015 03:10:33)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
    with Xdebug v2.1.4, Copyright (c) 2002-2012, by Derick Retinas

This can be resolved by removing the !empty() on lines 48, 58, and 71 - see attached patch.

Revision history for this message
Darren James Harkness (darren-athabascau) wrote :
Changed in mahara:
milestone: none → 16.04.0
importance: Undecided → High
Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "master" branch: https://reviews.mahara.org/6401

Revision history for this message
Robert Lyon (robertl-9) wrote :

Hi Darren

Thank you for spotting this mistake

I've added your patch to the review system
https://reviews.mahara.org/#/c/6401/1

Cheers

Robert

Aaron Wells (u-aaronw)
Changed in mahara:
status: New → In Progress
Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/6401
Committed: https://git.mahara.org/mahara/mahara/commit/820860024e00862691169a32f9da729c373a5a05
Submitter: Robert Lyon (<email address hidden>)
Branch: master

commit 820860024e00862691169a32f9da729c373a5a05
Author: Darren Harkness <email address hidden>
Date: Tue Apr 26 17:06:31 2016 +1200

Bug 1574716: Can't use empty() on a function return value in PHP 5.3

behatnotneeded - issue with older versions of php

Change-Id: Ib732c593a1bbd37bf35cd747b9b57c992b8c1681
Signed-off-by: Robert Lyon <email address hidden>

Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "16.04_STABLE" branch: https://reviews.mahara.org/6407

Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/6407
Committed: https://git.mahara.org/mahara/mahara/commit/40d2158daab8b5512a0bbadbd64fede4d4026d0a
Submitter: Robert Lyon (<email address hidden>)
Branch: 16.04_STABLE

commit 40d2158daab8b5512a0bbadbd64fede4d4026d0a
Author: Darren Harkness <email address hidden>
Date: Tue Apr 26 17:06:31 2016 +1200

Bug 1574716: Can't use empty() on a function return value in PHP 5.3

behatnotneeded - issue with older versions of php

Change-Id: Ib732c593a1bbd37bf35cd747b9b57c992b8c1681
Signed-off-by: Robert Lyon <email address hidden>
(cherry picked from commit 820860024e00862691169a32f9da729c373a5a05)

Robert Lyon (robertl-9)
Changed in mahara:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.