#23746 [NEW]: Default values do not work when $_POST is set

From: Date: Wed, 21 May 2003 23:49:49 +0000
Subject: #23746 [NEW]: Default values do not work when $_POST is set
Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-16601@lists.php.net to get a copy of this message
From: nlenz at ivcf dot org Operating system: Linux PHP version: 4.3.1 PHP Bug Type: PEAR related Bug description: Default values do not work when $_POST is set Description of problem: 1. $_POST["someUnrelatedVar"] is set. 2. Create a QuickForm object using POST 3. Call setDefaults() 4. Default values will not show up, even though the element's name was not set in $_POST. Solution: In the element.php file, onQuickFormEvent method. Change: if (isset($caller->_submitValues) && count($caller->_submitValues) > 0) { To: if (isset($caller->_submitValues) && count($caller->_submitValues) > 0 && $this->_findValue($caller->_submitValues) != null) { -- Edit bug report at http://bugs.php.net/?id=23746&edit=1 -- Try a CVS snapshot: http://bugs.php.net/fix.php?id=23746&r=trysnapshot Fixed in CVS: http://bugs.php.net/fix.php?id=23746&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=23746&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=23746&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=23746&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=23746&r=support Expected behavior: http://bugs.php.net/fix.php?id=23746&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=23746&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=23746&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=23746&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=23746&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=23746&r=dst IIS Stability: http://bugs.php.net/fix.php?id=23746&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=23746&r=gnused

« previous php.pear.dev (#16601) next »