Hans Lellelid | 2 Apr 2008 19:21

Re: Re: A problem with addJoin() in Criteria

I'm not sure I understand why you are adding the same join multiple 
times .... However, we can make Propel only allow unique joins in the 
Criteria; that does seem fine & not a large change, clearly.

Hans

Kiril Angov wrote:
> Any problems with implementing this? I am using propel from SVN and I
> have to ask all my teammates to make this change by hand and then if
> we push to staging and production we have to make it there too. Sorry
> to be bugging but...
>
> Kiril
>
> On Wed, Apr 2, 2008 at 2:35 AM, Kiril Angov <kupokomapa <at> gmail.com> wrote:
>   
>> Hello guys,
>>
>>  while debugging and issue with Symfony I came to realize that in
>>  http://propel.phpdb.org/trac/browser/branches/1.3/runtime/classes/propel/util/Criteria.php
>>  in the method addJoin() you do not check if the join is already added
>>  and that causes problems with criteria objects that add the same join
>>  more than once. Is it OK if you add something like the code bellow
>>  (you just need an ID for the array keys)
>>
>>  public function addJoin($left, $right, $operator = null)
>>  {
>>   $id = hash('md5', $left.', '.$right.', '.$operator);
>>   if (!isset($this->joins[$id])) {
>>     $this->joins[$id] = new Join($left, $right, $operator);
>>   }
>>   return $this;
>>  }
>>
>>  Thanks,
>>  Kiril
>>
>>     
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe <at> propel.tigris.org
> For additional commands, e-mail: dev-help <at> propel.tigris.org
>
>   

Gmane