|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits              [2004-12-23 10:48 UTC] elias at hallerjugend dot at
  [2005-01-11 13:54 UTC] borz_off at cs dot msu dot su
  [2005-06-13 09:29 UTC] borz_off at cs dot msu dot su
 | |||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 08:00:01 2025 UTC | 
Description: ------------ If you define a password compare rule after a frozen element, you'll get an error like: Fatal error: Call to a member function on a non-object in QuickForm.php on line 1563 After 2 hours of researching I found the error. In the method "getValidationScript" is a loop, where the variable $element points to $this->_elements[$elementKey]. If the element is frozen, the loop will be skipped. In the next run of the loop the password compare rule will be handled. The variable $dependent will be true, and the object $element will be overwritten with an array(). But $element still points to $this->_elements[$elementKey] like i mentioned above and so $this->_elements[$elementKey] will also be overwritten. This causes the error. The solution is to add unset($element) before the lopp will be skipped. Here is the correct Code: Reproduce code: --------------- // Line 1669 in Script HTML/Quickform.php // No JavaScript validation for frozen elements if (is_object($element) && $element->isFrozen()) { unset($element); continue 2; } elseif (is_array($element)) { foreach (array_keys($element) as $key) { if ($element[$key]->isFrozen()) { unset($element); continue 3; } } }