CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Drupal Modules (Moderator: Donald Lobo) »
  • Oh views guru - where are thou?
Pages: [1]

Author Topic: Oh views guru - where are thou?  (Read 1294 times)

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Oh views guru - where are thou?
August 23, 2009, 03:26:49 am
Hi there,

I tried adding the 'location name' field to an event view and I got an invalid query:

SELECT civicrm_event.id AS id,
   civicrm_event.title AS civicrm_event_title,
   civicrm_event.start_date AS civicrm_event_start_date,
   civicrm_event.end_date AS civicrm_event_end_date,
   civicrm_loc_block.name AS civicrm_loc_block_name
 FROM civicrm_event civicrm_event
 LEFT JOIN civicrm_loc_block civicrm_loc_block ON civicrm_event.loc_block_id = civicrm_loc_block.id
 WHERE (civicrm_event.event_type_id in ('7')) AND (civicrm_event.is_active <> 0) AND (civicrm_event.end_date >= '2009-08-24 21:33:38') AND (civicrm_event.is_public <> 0)

The 'civicrm_loc_block.name' field doesn't exist (2.2.8). Perhaps it should just be removed - I think the address fields cover it - assuming that civicrm_address.street_name is the 'name field'?


Here are relevant bits from the views module (THey aren't sequential )

Code: [Select]
    //CiviCRM Address Using Locations as a pitstop before going on to Events
    $data['civicrm_address']['table']['join']['civicrm_event'] = array(
                                                                       'left_table' => 'civicrm_loc_block',
                                                                       'left_field' => 'address_id',
                                                                       'field' => 'id',
                                                                       );

    // CHILLING OUT AT THE CIVICRM_LOC_BLOCK TABLE

    $data['civicrm_loc_block']['table']['group']  = t('CiviCRM Locations');

    // Explain how this table joins to others.
    $data['civicrm_loc_block']['table']['join'] = array(
                                                        // Directly links to event table
                                                        'civicrm_event' => array(
                                                                                 'left_field' => 'loc_block_id',
                                                                                 'field' => 'id',
                                                                                 ),
                                                        );

//THE NAME OF THE LOCATION
    $data['civicrm_loc_block']['name'] = array(
                                               'title' => t('Name'),
                                               'help' => t('The Name of the Event Location'),
                                               'field' => array(
                                                                'handler' => 'views_handler_field',
                                                                'click sortable' => TRUE,
                                                                ),

                                               'argument' => array(
                                                                   'handler' => 'views_handler_argument',
                                                                   ),

                                               'filter' => array(
                                                                 'handler' => 'views_handler_filter_string',
                                                                 ),

                                               'sort' => array(
                                                               'handler' => 'views_handler_sort',
                                                               ),
                                               );

    //FULL STREET ADDRESS
    $data['civicrm_address']['street_address'] = array(
                                                       'title' => t('Full Street Address'),
                                                       'help' => t('Full Street Address without Country, State or Postcode'),
                                                       'field' => array(
                                                                        'handler' => 'views_handler_field',
                                                                        'click sortable' => TRUE,
                                                                        ),

                                                       'argument' => array(
                                                                           'handler' => 'views_handler_argument',
                                                                           ),

                                                       'filter' => array(
                                                                         'handler' => 'views_handler_filter_string',
                                                                         ),

                                                       'sort' => array(
                                                                       'handler' => 'views_handler_sort',
                                                                       ),
                                                       )

Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Oh views guru - where are thou?
August 23, 2009, 03:29:47 am
Oh, just noticed there is a 'civicrm_address.name' field but it isn't populated for my event locations. I just created a new location in 2.2.8 and it didn't get populated - anyone know when it does get populated?
« Last Edit: August 23, 2009, 03:54:42 am by Eileen »
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Drupal Modules (Moderator: Donald Lobo) »
  • Oh views guru - where are thou?

This forum was archived on 2017-11-26.