Development

Changeset 13382

You must first sign up to be able to contribute.

Changeset 13382

Show
Ignore:
Timestamp:
11/27/08 08:28:52 (7 months ago)
Author:
fabien
Message:

[1.2] fixed sfObjectRoute to work with Doctrine when no object is returned (closes #5090, #5091)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/1.2/lib/routing/sfObjectRoute.class.php

    r13046 r13382  
    107107 
    108108    // check the related object 
    109     if (is_null($this->object = $this->getObjectForParameters($this->parameters)) && (!isset($this->options['allow_empty']) || !$this->options['allow_empty'])) 
     109    if (!($this->object = $this->getObjectForParameters($this->parameters)) && (!isset($this->options['allow_empty']) || !$this->options['allow_empty'])) 
    110110    { 
    111111      throw new sfError404Exception(sprintf('Unable to find the %s object with the following parameters "%s").', $this->options['model'], str_replace("\n", '', var_export($this->filterParameters($this->parameters), true)))); 
     
    141141    $this->objects = $this->getObjectsForParameters($this->parameters); 
    142142 
    143     if (is_array($this->objects) && !count($this->objects) && isset($this->options['allow_empty']) && !$this->options['allow_empty']) 
     143    if (!count($this->objects) && isset($this->options['allow_empty']) && !$this->options['allow_empty']) 
    144144    { 
    145145      throw new sfError404Exception(sprintf('No %s object found for the following parameters "%s").', $this->options['model'], str_replace("\n", '', var_export($this->filterParameters($this->parameters), true)))); 

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.