I seem to have found what looks like a bug in DbFinder, although it's
possible I'm not using it correctly so I thought i'd ask here first
before submitting a ticket.

When I attempt to order by a non-PK column, it adds that column a
second time to the returned assoc array as an uppercase value with no
defined key.

e.g.

Using a PK column to order by:
$this->eventTypes = DbFinder::from('EventType')
  ->select(array('EventType.EventTypeId', 'EventType.Name',
'EventTypePerNewsItem.NewsItemId'))
  ->leftJoin('EventType.EventTypeId',
'EventTypePerNewsItem.EventTypeId')
  ->where('EventTypePerNewsItem.NewsItemId', $this->newsItem-
>getNewsItemId())
  ->orderBy('EventType.EventTypeId')
  ->find();

returns:
Array
(
    [0] => Array
        (
            [EventType.EventTypeId] => 101
            [EventType.Name] => Highlights
            [EventTypePerNewsItem.NewsItemId] => 882
        )

    [1] => Array
        (
            [EventType.EventTypeId] => 13002
            [EventType.Name] => Rock
            [EventTypePerNewsItem.NewsItemId] => 882
        )

    [2] => Array
        (
            [EventType.EventTypeId] => 15002
            [EventType.Name] => Special Interest
            [EventTypePerNewsItem.NewsItemId] => 882
        )

)

which is normal,

whereas:
$this->eventTypes = DbFinder::from('EventType')
  ->select(array('EventType.EventTypeId', 'EventType.Name',
'EventTypePerNewsItem.NewsItemId'))
  ->leftJoin('EventType.EventTypeId',
'EventTypePerNewsItem.EventTypeId')
  ->where('EventTypePerNewsItem.NewsItemId', $this->newsItem-
>getNewsItemId())
  ->orderBy('EventType.Name')
  ->find();

returns:
Array
(
    [0] => Array
        (
            [EventType.EventTypeId] => 101
            [EventType.Name] => Highlights
            [EventTypePerNewsItem.NewsItemId] => 882
            [] => HIGHLIGHTS
        )

    [1] => Array
        (
            [EventType.EventTypeId] => 13002
            [EventType.Name] => Rock
            [EventTypePerNewsItem.NewsItemId] => 882
            [] => ROCK
        )

    [2] => Array
        (
            [EventType.EventTypeId] => 15002
            [EventType.Name] => Special Interest
            [EventTypePerNewsItem.NewsItemId] => 882
            [] => SPECIAL INTEREST
        )

)

which throws a notice:
Notice: Undefined offset: 3 in /path/to/plugins/DbFinderPlugin/lib/
propel/sfPropelFinder.php on line 905
because there are more columns returned than I requested initially.


This is with Symfony 1.0.20 / Propel 1.2 / DbFinder 1.2.2, not sure if
it does the same on other combinations.



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to