Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-9068

Location block not displaying in create new event wizard

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Minor
    • Resolution: Won't Fix
    • Affects Version/s: 3.4.7
    • Fix Version/s: 4.1.0
    • Component/s: CiviEvent
    • Labels:
      None

      Description

      If there no existing events using an event location block, then the radio buttons allowing the user to either "Create new location" or "Use existing location" will not be displayed on the location tab of the event wizard.

      This is happening whenever the SQL query in the function CRM_Event_BAO_Event::getLocationEvents( )

      SELECT CONCAT_WS(' :: ' , ca.name, ca.street_address, ca.city, sp.name) title, ce.loc_block_id
      FROM civicrm_event ce
      INNER JOIN civicrm_loc_block lb ON ce.loc_block_id = lb.id
      INNER JOIN civicrm_address ca ON lb.address_id = ca.id
      LEFT JOIN civicrm_state_province sp ON ca.state_province_id = sp.id
      ORDER BY sp.name, ca.city, ca.street_address ASC

      returns an empty result set.

      This is a catch-22 for the user because since they are not given the option to create a new location block, there is no way theSQL query will ever get any matching records.

      I have found 2 possible solutions:
      A) Show the radio buttons allowing the user to either "Create new location" or "Use existing location" no matter what.

      B) Change the SQL query to:
      SELECT CONCAT_WS(' :: ' , ca.name, ca.street_address, ca.city, sp.name) title, lb.id
      FROM civicrm_loc_block lb
      INNER JOIN civicrm_address ca ON lb.address_id = ca.id
      LEFT JOIN civicrm_state_province sp ON ca.state_province_id = sp.id
      ORDER BY sp.name, ca.city, ca.street_address ASC

        Attachments

          Activity

            People

            • Assignee:
              kurund Kurund Jalmi
              Reporter:
              sgladstone Sarah Gladstone
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: