Subpanel custom function get_subpanel_data fail on delete relationship


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',
  '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



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