I have Moodle packaged locally and have been running it in production for quite some time now. Moodle uses some of the pear libraries, but ships its own bundled copy of them. It allows you to delete the bundled ones and then it will use the system ones. RedHat and Mandriva have done this in their Moodle package and I have in mine as well. There are some bugs in the HTML_QuickForm and related code that Moodle fixed in their bundled copy, but for whatever reason didn't submit upstream, and now upstream appears dead. I'd like to include their fixes in our packages, to stop the errors getting logged that these bugs cause. I have literally hundreds of megabytes of log messages with these errors. I have confirmed that patching the pear stuff gets rid of the errors and doesn't cause any problems (and from the code changes, it shouldn't cause problems). I've broken up the changes into different patches, which will all be attached in a zip file (as Bugzilla corrupts patches attached directly, that's why I'll put them in a zip file). I'm hoping you Thomas can help with this, as pear is a little uncooperative and doesn't like things to be patched. If I just apply one of my patches in the %prep section the normal way, the patches files get excluded from the installation and don't end up in the package for some reason. For it to work, I actually had to go to the end of the %install section and patch the installed copy in the buildroot like the following. Maybe you know of a better way to do this: cd %{buildroot}%{_datadir}/pear/HTML patch -p2 < %{PATCH0} The first patch is: HTML_QuickForm-3.2.13-errors.patch This patch fixes the errors I'm actually seeing in my logs, which are mainly due to three things. One is "assigning return value of new by reference is deprecated" in PHP 5.3, i.e., doing something =& new something is wrong, and should just be something = new something without the &. Another issue is functions that should be static and get called statically not being declared static when they should have been. Finally, some functions in subclasses override functions in base classes but the signature wasn't the same ("declaration of foo() should be compatible with..."). The next patch is: HTML_QuickForm_Controller-1.0.10-errors.patch This fixes another "new by reference" problem in HTML/QuickForm/Controller.php. The next patches are: HTML_Common-1.2.5-raiseError.patch HTML_QuickForm-3.2.13-raiseError.patch HTML_QuickForm_Controller-1.0.10-raiseError.patch This fixes another issue with a non-static function PEAR::raiseError being called statically. I haven't had errors due to this logged in my logs, but obviously that's just because none of the raiseError calls have been hit. So in this set of patches, raiseError is overridden in a base class in HTML_Common, then all of the subclasses in the QuickForm code call it through self instead of PEAR. The last three patches are other fixes from Moodle. I'm not sure exactly what they fix, but they should be safe. The patches are: HTML_QuickForm-3.2.13-moodle1.patch HTML_QuickForm-3.2.13-moodle2.patch HTML_QuickForm-3.2.13-moodle3.patch moodle1.patch addresses some issues with _generateId() in the checkbox code. There is one comment in there hinting to what the issue with that was. moodle2.patch adds a default value for the options argument (= null) in the validate functions. That may be another declaration should be compatible issue. moodle3.patch protects a couple duplicateIndex calls inside of an if statement just in case currentName is empty. Reproducible: Steps to Reproduce:
Created attachment 3609 [details] All of the patches in a zip file (patches.zip)
Thanks a lot for your work on this. I never cleaned up this RPM because it's supposed to be replaced. I never pearized it either. I am surprised it actually works without the %posts. Unfortunately, this package isn't developed anymore, but it says bugs and security issues would be taken care of. pear packages have an md5sum for every file. I have never been able to apply patches, except to go into the files, make the (minor) changes, extract the md5sum and put the correct one into the xml file and then re tar and gz the source. Maybe, if you submit your request to upstream with a good story, it would be included.
I don't think anyone upstream is taking care of any bugs in this. There hasn't been a release in 2 years and the bugs that are causing most of the error log messages would have been there since PHP 5.3 came out. How would these be submitted upstream if there's no active upstream? Also, how can we fix these in the meantime?
I don't see a bug report upstreams. Please file one. As I mentioned further up in this post, patching pear packages is almost impossible. If you don't file a bug upstream (I would support it) we may should upgrade this package to HTML_QuickForm2 after mga3 release. You have apparently solved your problem and there is no mga3 package that experiences this problem.
(In reply to Thomas Spuhler from comment #4) > I don't see a bug report upstreams. Please file one. Where? > As I mentioned further up in this post, patching pear packages is almost > impossible. > If you don't file a bug upstream (I would support it) we may should upgrade > this package to HTML_QuickForm2 after mga3 release. > You have apparently solved your problem and there is no mga3 package that > experiences this problem. I have not solved it, and yes, the moodle package experiences these problems.
Another Moodle patch, this time to pear/Auth/RADIUS.php. It fixes https://tracker.moodle.org/browse/MDL-38373 --- pear/Auth/RADIUS.php.orig 2013-07-24 12:42:03.686249955 -0400 +++ pear/Auth/RADIUS.php 2013-07-24 12:42:37.286243054 -0400 @@ -46,7 +46,6 @@ * @version $Revision: 257341 $ */ -PEAR::loadExtension('radius'); /** * class Auth_RADIUS @@ -127,6 +126,7 @@ */ function Auth_RADIUS() { + $this->loadExtension('radius'); $this->PEAR(); } --
Patching pear packages isn't straight forward, because the way they are being built.But if you submit the fix upstream, they may include it as the package is still being maintained for bugs. But this package has been replaced upstream by HTML_QuickForm2 Does this have the same issues?
Status: NEW => ASSIGNED
(In reply to Thomas Spuhler from comment #7) > Patching pear packages isn't straight forward, because the way they are > being built.But if you submit the fix upstream, they may include it as the > package is still being maintained for bugs. But this package has been > replaced upstream by HTML_QuickForm2 > Does this have the same issues? As I've said before, I have no idea how to report any of this upstream, and HTML_QuickForm2 is a completely different piece of software, not a drop-in replacement, so Moodle would have to be ported to it to even know.
I fixed php-pear-HTML_QuickForm in Cauldron I will close this. If the problem is still there, please reopen. Unfortunately, if it's not fixed upstream, it will resurface at the next update by upstream.
Status: ASSIGNED => RESOLVEDResolution: (none) => FIXED
Let's please not close this bug yet (also HTML_QuickForm isn't the only package indicated in this bug), as there's a lot of info here and I haven't finished looking into this.
Status: RESOLVED => REOPENEDResolution: FIXED => (none)
David: Since this bug is over a year old, is it still valid or has Moodle been upgraded to use HTML_QuickForm2 Thomas
Unfortunately, Moodle hasn't changed. Please leave this open for now. I plan on checking with Fedora about this, but I won't have time until May
I updated the spec in Cauldron, so it should accept patches and update the md5sum I am going to reassing this bug to David Walser
CC: (none) => thomasAssignee: thomas => luigiwalser
Created attachment 5681 [details] All of the patches in a zip file (patches.zip) It looks like they've changed from DOS to UNIX line endings in HTML_QuickForm 3.2.14. A couple of the changes from the patches I posted were made in 3.2.14, but many were not. I've rediffed the patches for HTML_QuickForm 3.2.14 and added them to the patches zipfile.
Attachment 3609 is obsolete: 0 => 1
fixed in svn, asked for freeze push
Status: REOPENED => RESOLVEDResolution: (none) => FIXED
Thanks. As before, I'd like to keep this open so I don't lose the information.
64b
CC: (none) => richard
@David can we close this now?
CC: (none) => mageia
Sure, we don't have Moodle anymore.
Status: REOPENED => RESOLVEDResolution: (none) => OLD