I have a problem with relationships (m:n) and subpanels in custom modul:
The detail view shows the subpanel for the related module.
When I want to add some items, the popup is shown, i can select items and clicking âselectâ.
The selected items will not be saved to the m:n table, the generated sql insert string has an error.
When i look at the insert string, there is a wrong field name, the field prefix is whithout underscore:
- gnerated field: âfim locations_idâ
- correct field name: âfim_locations_idâ
// from system generated insert string:
INSERT INTO fim_location_projects (id,name,date_entered,date_modified,modified_user_id,created_by,description,deleted,assigned_user_id,fim locations_id,fim_projects_id) VALUES (âed5d6084-c39a-363d-43e8-5d4da2a75811â,âSample Location Wolfschlucht - Aktionsangeboteâ,â2019-08-09 16:41:00â,â2019-08-09 16:41:00â,â7be40e7e-1ae7-62f8-d37c-5b93c25d6242â,â7be40e7e-1ae7-62f8-d37c-5b93c25d6242â,ââ,0,â7be40e7e-1ae7-62f8-d37c-5b93c25d6242â,ââ,â9e230ae6-b487-ddd7-1f1d-5d04c16d91f6â)
// relationship definition in custom/metadata/fim_locations_fim_projectsMetaData.php
$dictionary[âfim_locations_fim_projectsâ] = array (
âtrue_relationship_typeâ => âmany-to-manyâ,
ârelationshipsâ =>
array (
âfim_locations_fim_projectsâ =>
array (
âlhs_moduleâ => âFIM_Locationsâ,
âlhs_tableâ => âfim_locationsâ,
âlhs_keyâ => âidâ,
ârhs_moduleâ => âFIM_Projectsâ,
ârhs_tableâ => âfim_projectsâ,
ârhs_keyâ => âidâ,
ârelationship_typeâ => âmany-to-manyâ,
âjoin_tableâ => âfim_location_projectsâ,
âjoin_key_lhsâ => âfim_locations_idâ,
âjoin_key_rhsâ => âfim_projects_idâ,
),
),
âtableâ => âfim_location_projectsâ,
âfieldsâ => âŚ
// code from /custom/Extension/modules/Fim_Projects/Ext/Vardefs/fim_locations_fim_projects_FIM_Projects.php
$dictionary[âFIM_Projectsâ][âfieldsâ][âfim_locations_fim_projectsâ] = array (
ânameâ => âfim_locations_fim_projectsâ,
âtypeâ => âlinkâ,
ârelationshipâ => âfim_locations_fim_projectsâ,
âsourceâ => ânon-dbâ,
âmoduleâ => âFIM_Locationsâ,
âbean_nameâ => âFIM_Locationsâ,
âvnameâ => âLBL_FIM_LOCATIONS_FIM_PROJECTS_FROM_FIM_LOCATIONS_TITLEâ,
);
// subpanel defintiion code from custom/Extension/modules/Fim_Projects/Ext/Vardefs/fim_locations_fim_projects_FIM_Projects.php
$layout_defs[âFIM_Projectsâ][âsubpanel_setupâ][âfim_locations_fim_projectsâ] = array (
âorderâ => 100,
âmoduleâ => âFIM_Locationsâ,
âsubpanel_nameâ => ââ,
âsort_orderâ => âascâ,
âsort_byâ => ânameâ,
âtitle_keyâ => âLBL_FIM_LOCATIONS_FIM_PROJECTS_FROM_FIM_LOCATIONS_TITLEâ,
âget_subpanel_dataâ => âfim_location_projectsâ,
âtop_buttonsâ => array (
0 => array (
âwidget_classâ => âSubPanelTopSelectButtonâ,
âmodeâ => âMultiSelectâ,
),
1 => array (
âwidget_classâ => âSubPanelTopButtonQuickCreateâ,
),
),
);
I have no idea how to handle this, for me looks the right done.
The only thing is the generated sql insert code, but how can i prevent this ?
kind regards
Rolf