Doctrine 1
  1. Doctrine 1
  2. DC-56

Geographical behavior does not calculate distance

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.0.12, 1.1.4, 1.2.0-ALPHA2
    • Fix Version/s: 1.0.12, 1.1.4, 1.2.0-ALPHA2
    • Component/s: None
    • Labels:
      None

      Description

      If the fields name of the latitude or longitude invoker aren't 'latitude' or 'longitude', then the getDistanceQuery doesn't not work.

      milesSql = sprintf($sql, $invoker->get('latitude'), $invoker->get('latitude'), $invoker->get('longitude'), '1.1515', 'miles');
      ...
      $kilometersSql = sprintf($sql, $invoker->get('latitude'), $invoker->get('latitude'), $invoker->get('longitude'), '1.1515 * 1.609344', 'kilometers');
      

      Replacing latitude by $latName (previously defined line 74 and 75) resolved this problem.

      Here's the fix :

      milesSql = sprintf($sql, $invoker->get($latName), $invoker->get($latName), $invoker->get($longName), '1.1515', 'miles');
      ...
      $kilometersSql = sprintf($sql, $invoker->get($latName), $invoker->get($latName), $invoker->get($longName), '1.1515 * 1.609344', 'kilometers');
      

        Activity

        Hide
        Jonathan H. Wage added a comment -

        This is fixed already in the latest 1.2 version.

        Show
        Jonathan H. Wage added a comment - This is fixed already in the latest 1.2 version.

          People

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

            Dates

            • Created:
              Updated:
              Resolved: