Doctrine 1
  1. Doctrine 1
  2. DC-683

orderBy many field defined in yml files doesnt work

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Trivial Trivial
    • Resolution: Fixed
    • Affects Version/s: 1.2.0, 1.2.1, 1.2.2
    • Fix Version/s: 1.2.3
    • Component/s: None
    • Labels:
      None
    • Environment:
      symfony - sfDoctrinePlugin, MySQL

      Description

      Hi,
      When you have defined orderBy table option in yml file, like:

      orderBy[ field1 ASC, field2 DESC ]

      and models build by doctrine:build --model

      Doctrine_Table class reports warnings, when executing select query i.e.:
      Warning: array_map() [function.array-map]: Argument #2 should be an array in ....\doctrine\Doctrine\Table.php on line 1134

      that's causes no order at all in sql query

      quick solution for this problem is change file \doctrine\Doctrine\Table.php, function processOrderBy() - around line 1134

      from:

      $e1 = explode(',', $orderBy);

      to:

      if( !is_array($orderBy)){
      $e1 = explode(',', $orderBy);
      }else{
      $e1 = $orderBy;
      }

      hope it helps to someone

      best,
      Wojtek

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            Jonathan H. Wage
            Reporter:
            wojtek kolodziejczyk
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: