Where would a customization for "Load more" button in subpanel be?

Hello. I have to do some "detective work". One of our clients have a customization specific to them so that when they click the "load more" button for the Opportunities subpanel from Accounts module, they system does 2 queries. The "regular" one that should happen, and another one that like the first one but offset with 5 records and some missing joins, that overwrite stuff. This is a very very old site that got upgraded during years, step by step since 6.5 era. I checked subpanel definition PHP and record and relate.js files, nothing suspicious. Where should I continue my hunt?

Parents
  • I have no clue, but if I was spelunking I would start by digging in custom fields or extensions to existing fields simply because it's a button...

    So maybe look in

    custom/modules/Opportunities/clients/base/fields?

    or in custom/clients/base/fields?

    and see if anything sticks out at you...

    Good luck!

  • No custom fields relevant to Opp. in the system. And by the way, I just found out that in fact the load more button end up showing records from a DIFFERENT account. So this guides my thoughts towards permissions/roles. Can something be afoot there?


  • My next step (which in hind sight should have been the first) would be to check the subpanel layout:
    clients/base/layouts/subpanel/subpanel.php

    The components suggest that the bottom of the panel is defined in "list-bottom"


    $viewdefs['base']['layout']['subpanel']  = array (
        'template' => 'panel',
        'components' => array (
            array (
                'view' => 'panel-top',
            ),
            array (
                'view' => 'subpanel-list',
            ),
            array (
                'view' => 'list-bottom',
            ),
        ),
        'last_state' => array(
            'id' => 'subpanel'
        ),
    );

    That suggests that there is a list-bottom view and indeed there is one:

    /clients/base/views/list-bottom/

    and it defines the 'showMoreRecords' event:

        events: {
            'click [data-action="show-more"]': 'showMoreRecords'
        },


    so I would check if there is a custom/modules/Opportunities/clients/base/view/list-bottom

    that overrides the default showMoreRecords

    When we redefine panel-top we do so by using the override_paneltop_view and defining a totally different panel-top view, there could be something in your code that redefines the list-bottom. So I would also check
    /custom/modules/Opportunities/clients/base/layouts
    and for good measure if you don't find anything there, also check if something really strange was done to /custom/clients/base/layouts  or goodness forbid clients/base/layout (though no one should be touching anything outside custom, you never know...)

  • I ran a grep -R -l command in the file system for showMoreRecords and a separate one for data-action="show-more" and both indicate only one file, the base sugar one. I compared with the original and they are the same, it has not been customized. So.. not custom list-bottom, not layout, not custom button, not a field, where the hell is the modification :((

Reply Children