Filter on Accounts | Not populating data on filter_relate

Hi all.

I hope someone can help with this, I am doing a simple filter on a V7.9 site. I've done this on my V9 site without any issue but this customer is slightly far behind. I've applied the exact same logic on both and the V7.9 site unfortunately just will not play ball with populating some data.

I've created a filter within custom/Extension/modules/hb_Hotel_Brand/Ext/clients/base/filters/basic

<?php

$viewdefs['hb_Hotel_Brand']['base']['filter']['basic']['filters'][] = array(
    'id' => 'filterHotelBrand',
    'name' => 'LBL_FILTER_HOTEL_BRAND',
    'filter_definition' => array(
        array(
            'hotel_group' => array(
                '$in' => '',
            ),
        ),
    ),
    'editable' => true,
    'is_template' => true,
);

I've then added it to my accounts record.php looking on a relate field as the following shows:

18 => 
              array (
                'name' => 'hotel_brand_relate_c',
				'initial_filter' => 'filterHotelBrand',
				'initial_filter_label' => 'LBL_FILTER_HOTEL_BRAND',
				'filter_relate' => array(
					'hotel_brand_c' => 'hotel_group'
				),
                'studio' => 'visible',
                'label' => 'LBL_HOTEL_BRAND_RELATE',
              ),

The filter is applied absoutely no problem when I open the drawer, however on this customer site, the hotel_group part of the filter isn't populated by the information in hotel_brand_c, as mentioned I've had no issues on my main test site. But I cannot find anything that explains this?

The only thing I did find was that on the V7.9 site in the logs, it tries to do where hotel_group in ([OBJECT object]) which is wrong but I cannot fix.

Does anyone have any ideas?

Thanks!

Parents
  • Hi Daniel,

    Can you just modify this line in your template file as below  and check if if helps or not. Change the  line '$in' => '', to '$in' => array(), so your template code should look like this.

    <?php
    $viewdefs['hb_Hotel_Brand']['base']['filter']['basic']['filters'][] = array(
           'id' => 'filterHotelBrand',
           'name' => 'LBL_FILTER_HOTEL_BRAND',
           'filter_definition' => array(
                array(
                      'hotel_group' => array(
                      '$in' => array(),
                       ) ,
                 ) ,
            ) ,
           'editable' => true,
           'is_template' => true,
    );

    ?>

    After making the code changes, please perform repair and rebuild and check this. Please try this in your development or test instance first. Let us know if it helps. If still if you are not able to acheieve let us debug this further. Thank you.

Reply
  • Hi Daniel,

    Can you just modify this line in your template file as below  and check if if helps or not. Change the  line '$in' => '', to '$in' => array(), so your template code should look like this.

    <?php
    $viewdefs['hb_Hotel_Brand']['base']['filter']['basic']['filters'][] = array(
           'id' => 'filterHotelBrand',
           'name' => 'LBL_FILTER_HOTEL_BRAND',
           'filter_definition' => array(
                array(
                      'hotel_group' => array(
                      '$in' => array(),
                       ) ,
                 ) ,
            ) ,
           'editable' => true,
           'is_template' => true,
    );

    ?>

    After making the code changes, please perform repair and rebuild and check this. Please try this in your development or test instance first. Let us know if it helps. If still if you are not able to acheieve let us debug this further. Thank you.

Children
No Data