Bug 1402833

Summary: php-pear-HTML-QuickForm doesn't work with PHP 7
Product: [Fedora] Fedora Reporter: Jonathan Dieter <jonathan>
Component: php-pear-HTML-QuickFormAssignee: Remi Collet <fedora>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 25CC: fedora
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: php-pear-HTML-QuickForm-3.2.14-4.fc25 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-12-16 20:59:07 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Fixes PHP 7 compatibility none

Description Jonathan Dieter 2016-12-08 12:42:20 UTC
Created attachment 1229458 [details]
Fixes PHP 7 compatibility

Description of problem:
HTML_QuickForm doesn't actually work with PHP 7.  In several places, it uses the code pattern "$variable =& new class()" which is now invalid.  The attached patch changes the pattern to "$variable = new class()".

There's an upstream pull request at https://github.com/pear/HTML_QuickForm/pull/7, but upstream has already rejected several requests because HTML_QuickForm has been superseded.

Version-Release number of selected component (if applicable):
php-pear-HTML-QuickForm-3.2.14-3.fc25.noarch

How reproducible:
Always

Steps to Reproduce:
1. Try to load HTML_QuickForm
2.
3.

Actual results:
Default exception handler: Exception - syntax error, unexpected 'new' (T_NEW) Debug: 
Error code: generalexceptionmessage
* line 128 of /usr/share/pear/HTML/QuickForm/RuleRegistry.php: ParseError thrown


Expected results:
It works

Comment 1 Remi Collet 2016-12-08 12:45:39 UTC
My plan is to definitively drop all the old deprecated pear modules.

This one was kept for moodle.
Please file a bug against moodle about this issue.

Comment 3 Fedora Update System 2016-12-08 13:00:37 UTC
php-pear-HTML-QuickForm-3.2.14-4.fc25 has been submitted as an update to Fedora 25. https://bodhi.fedoraproject.org/updates/FEDORA-2016-90363b68f4

Comment 4 Jonathan Dieter 2016-12-08 13:09:39 UTC
Thanks for applying this.  I did look into having Moodle just use its bundled HTML-QuickForm (which doesn't have this bug), but ran into file conflicts even when following the packaging guidelines for replacing a symlink with a directory.

I'll see if I can figure out a way to make it work so we can eventually drop this package.

Comment 5 Fedora Update System 2016-12-08 19:26:54 UTC
php-pear-HTML-QuickForm-3.2.14-4.fc25 has been pushed to the Fedora 25 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-90363b68f4

Comment 6 Fedora Update System 2016-12-16 20:59:07 UTC
php-pear-HTML-QuickForm-3.2.14-4.fc25 has been pushed to the Fedora 25 stable repository. If problems still persist, please make note of it in this bug report.