views:

437

answers:

1

I'm having an issue with Drupal 6 Views and a module of my own. I'm trying to get the query to use two Left Joins but it refuses to recognize the latter of the two. It's not an issue of order as I've switched them back and forth.

Can anyone see the issue? If there is one?

<?php


function mc_bhg_views_data() {

    $data['mc_bhg_status_ref'] = array(
        'table' => array(
            'group' => 'BHG Loan',
            'title' => 'mc_bhg_status_ref',
            'join' => array(
                'node' => array(
                    'left_field' => 'nid',
                    'field' => 'nid',        
                ),
            ),
        ),
    );
    $data['mc_bhg_status_names'] = array(
     'table' => array(
      'group' => 'BHG Loan',
      'title' => 'mc_bhg_status_names',
      'join' => array(
       'mc_bhg_status_refs' => array(
        'left_field' => 'status',
        'field' => 'id',
       ),
      ),
     ),
    );
    $data['mc_bhg_status_ref']['status'] = array(
        'title' => t('Status ID'),
        'help' => t('Relate Loan Status ID'),
        'field' => array(
            'handler' => 'views_handler_field',
            'click sortable' => TRUE,
        ),
        'filter' => array(
            'handler' => 'views_handler_filter_numeric',
        ),
    );
    $data['mc_bhg_status_names']['name'] = array(
        'title' => t('Status Name'),
        'help' => t('Relate the Loan Status Name'),
        'field' => array(
            'handler' => 'views_handler_field',
            'click sortable' => TRUE,
        ),
    );
    return $data;  
}
A: 

I'm not sure if this is Drupal 5 or six - I'm guessing five.

Is this your problem?

    $data['mc_bhg_status_names'] = array(
    'table' => array(
            'group' => 'BHG Loan',
            'title' => 'mc_bhg_status_names',
            'join' => array(
                    'mc_bhg_status_refs' => array(
                            'left_field' => 'status',
                            'field' => 'id',
                    ),
            ),
    ),
);

You're saying that you're joining to 'mc_bhg_status_refs' - with an 's' at the end, but in the first declaration you refer to it as 'mc_bhg_status_ref'.

John Fiala

related questions