Subpanel custom function get_subpanel_data fail on delete relationship

Hi,

I’m working on a custom subpanel using a custom get_subpanel_data function >>

 // created: 2022-10-26 20:19:05
$layout_defs["bids_Bids"]["subpanel_setup"]['bids_bids_documents_1'] = array (
  'order' => 100,
  'module' => 'Documents',
  'subpanel_name' => 'default',
  'sort_order' => 'asc',
  'sort_by' => 'id',
  'title_key' => 'LBL_BIDS_BIDS_DOCUMENTS_1_FROM_DOCUMENTS_TITLE',
  'get_subpanel_data' => 'function:get_documents_by_roles',
  'top_buttons' => 
  array (
    0 => 
    array (
      'widget_class' => 'SubPanelTopButtonQuickCreate',
    ),
  ),
);

This is working fine but when I tried to delete a document I created by the subpanel. The url pass the custom function as the linked_field instead of the actual relationship and make the delete relationship operation crash

eg:

http://localhost:8080/index.php?module=bids_Bids&action=DeleteRelationship&record=44c9c0ae-2768-c5f0-9e8d-62b3663701da&linked_field=get_documents_by_roles&linked_id=ca3cd6f9-b91a-d2ab-36c5-636bce3389d0

Any ideas on how to specify the linked_field for the relationship in the subpanel configuration?

Nvm, I found that an undocumented property exists>

 'set_subpanel_data' => 'bids_bids_documents_1'

it fixed everything

1 Like