Development

Changeset 10620

You must first sign up to be able to contribute.

Changeset 10620

Show
Ignore:
Timestamp:
08/02/08 22:15:35 (1 year ago)
Author:
nicolas
Message:

[1.2] backport of r10619 - fixed sfBrowser::click throw unexpected PHP error when trying to retrieve a value from an empty selectbox (with no option tags)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/1.2/lib/util/sfBrowser.class.php

    r9673 r10620  
    468468  /** 
    469469   * Test for an uncaught exception. 
    470    *  
     470   * 
    471471   * @return  boolean 
    472472   */ 
     
    641641 
    642642        // if no option is selected and if it is a simple select box, take the first option as the value 
    643         if (!$found && !$multiple) 
     643        $option = $xpath->query('descendant::option', $element)->item(0); 
     644        if (!$found && !$multiple && $option instanceof DOMElement) 
    644645        { 
    645           $value = $xpath->query('descendant::option', $element)->item(0)->getAttribute('value'); 
     646          $value = $option->getAttribute('value'); 
    646647        } 
    647648      } 

The Sensio Labs Network

Since 1998, Sensio Labs has been promoting the Open-Source software movement by providing quality web application development, training, consulting, and supporting several large Open-Source projects.