New sections created within a module layout are only shown as panels. Changing the Display Type to "Tab" does not have any effect.
Layout section showing as Tab.
Layout section showing as Panel.
As example we go with the account layout
medium priority
@brogsitter on my site same issue
@brogsitter Same Issue Here
FYI the bug does not exist in v. 7.9.2. Maybe this helps.
It looks like a saving issue on the Studio. Because after saving the panels as Tabs, if you reopen the EditView Layout in the Studio, you will see that the panels now again have the "Panel" display type and not "Tabs."
Also, it affects all panels, not just newly created ones. If you go and make any changes to an existing layout that has multiple panels, All those panels will get their display type reverted to Panels.
@thucar +1
The editviewdefs.php file of the Accounts module after having added a new panel(lbl_editview_panel1) in studio and moved the address fields in it looks like this (no manual edits):
<?php
$viewdefs ['Accounts'] =
array (
'EditView' =>
array (
'templateMeta' =>
array (
'form' =>
array (
'buttons' =>
array (
0 => 'SAVE',
1 => 'CANCEL',
),
),
'maxColumns' => '2',
'widths' =>
array (
0 =>
array (
'label' => '10',
'field' => '30',
),
1 =>
array (
'label' => '10',
'field' => '30',
),
),
'includes' =>
array (
0 =>
array (
'file' => 'modules/Accounts/Account.js',
),
),
'useTabs' => true,
'tabDefs' =>
array (
'LBL_ACCOUNT_INFORMATION' =>
array (
'newTab' => true,
'panelDefault' => 'expanded',
),
'LBL_EDITVIEW_PANEL1' =>
array (
'newTab' => true,
'panelDefault' => 'expanded',
),
'LBL_PANEL_ADVANCED' =>
array (
'newTab' => true,
'panelDefault' => 'expanded',
),
),
),
'panels' =>
array (
'lbl_account_information' =>
array (
0 =>
array (
0 =>
array (
'name' => 'name',
'label' => 'LBL_NAME',
'displayParams' =>
array (
'required' => true,
),
),
1 =>
array (
'name' => 'phone_office',
'label' => 'LBL_PHONE_OFFICE',
),
),
1 =>
array (
0 =>
array (
'name' => 'website',
'type' => 'link',
'label' => 'LBL_WEBSITE',
),
1 =>
array (
'name' => 'phone_fax',
'label' => 'LBL_FAX',
),
),
2 =>
array (
0 =>
array (
'name' => 'email1',
'studio' => 'false',
'label' => 'LBL_EMAIL',
),
),
3 =>
array (
0 =>
array (
'name' => 'description',
'label' => 'LBL_DESCRIPTION',
),
),
4 =>
array (
0 =>
array (
'name' => 'assigned_user_name',
'label' => 'LBL_ASSIGNED_TO',
),
),
),
'lbl_editview_panel1' =>
array (
0 =>
array (
0 =>
array (
'name' => 'billing_address_street',
'hideLabel' => true,
'type' => 'address',
'displayParams' =>
array (
'key' => 'billing',
'rows' => 2,
'cols' => 30,
'maxlength' => 150,
),
),
1 =>
array (
'name' => 'shipping_address_street',
'hideLabel' => true,
'type' => 'address',
'displayParams' =>
array (
'key' => 'shipping',
'copy' => 'billing',
'rows' => 2,
'cols' => 30,
'maxlength' => 150,
),
),
),
),
'LBL_PANEL_ADVANCED' =>
array (
0 =>
array (
0 => 'account_type',
1 => 'industry',
),
1 =>
array (
0 => 'annual_revenue',
1 => 'employees',
),
2 =>
array (
0 => 'parent_name',
),
3 =>
array (
0 => 'campaign_name',
),
),
),
),
);
$viewdefs['Accounts']['EditView']['templateMeta'] = array (
'form' =>
array (
'buttons' =>
array (
0 => 'SAVE',
1 => 'CANCEL',
),
),
'maxColumns' => '2',
'widths' =>
array (
0 =>
array (
'label' => '10',
'field' => '30',
),
1 =>
array (
'label' => '10',
'field' => '30',
),
),
'includes' =>
array (
0 =>
array (
'file' => 'modules/Accounts/Account.js',
),
),
'useTabs' => false,
'tabDefs' =>
array (
'LBL_ACCOUNT_INFORMATION' =>
array (
'newTab' => false,
'panelDefault' => 'expanded',
),
'LBL_PANEL_ADVANCED' =>
array (
'newTab' => false,
'panelDefault' => 'expanded',
),
),
);
?>
You can clearly see that the $viewdefs['Accounts']['EditView']['templateMeta'] is redefined and doing so nullifies your configuration in studio (also because it has: 'useTabs' => false, - this is why you get panels). By removing the second definition block by hand and clearing the cache things work - but as soon as you touch the view in studio again the viewdefs file is rewritten in the same way as before.
Versions 7.9.5 and 7.9.6 are definitely affected.
I'd argue for a High priority on this one because:
Hi all
does anyone know if there is any permanent fix about this issue?
Many thanks
+1
+1
@adamjakab For those of us who are new and struggling to figure out a manual fix, can you provide direction and/or code that can correct the missing tabs?
Thanks in advance
@1reason - Hi, sorry to disappoint you but I do not have one - the above code was to indicate a starting point to help out who will be looking into this. But I do not have a solution or the time to come up with one. I also confirm that this is still an issue in v.7.9.7.?
What you can do is every time you make a modification in studio to the edit/detail view definitions, open the corresponding editviewdefs.php or detailviewdefs.php file and manually remove the second
$viewdefs['Accounts']['DetailView']['templateMeta'] = array (...);
or
$viewdefs['Accounts']['EditView']['templateMeta'] = array (...);
block. Obviously not a solution but a workaround that works until you touch the view again in studio.
a\
Follow @adamjakab to remove the second templateMeta.
And need setup
'useTabs' => true
changed the panel which want to use as tab from
'newTab' => false,
to
'newTab' => true,
Then cache cache.
Bug still exists in
Version 7.9.7
Sugar Version 6.5.25 (Build 344)
and thanks for adding the bug... I was going crazy.
Hey guys, can any of you please test the Fix that PedroErnst provided? Thanks!
I can confirm, PedroErnst fix solves the issue. At least in Version 7.9.5
This fixes the issue in 7.9.8 also
Worked for me (twice), albeit it's a little hard to read with the comments.
@1reason sorry, I don't understand what you mean about the comments? If you can post a screenshot or explain, it would help. Thanks
Most helpful comment
The editviewdefs.php file of the Accounts module after having added a new panel(lbl_editview_panel1) in studio and moved the address fields in it looks like this (no manual edits):
You can clearly see that the
$viewdefs['Accounts']['EditView']['templateMeta']is redefined and doing so nullifies your configuration in studio (also because it has:'useTabs' => false,- this is why you get panels). By removing the second definition block by hand and clearing the cache things work - but as soon as you touch the view in studio again the viewdefs file is rewritten in the same way as before.Versions 7.9.5 and 7.9.6 are definitely affected.
I'd argue for a High priority on this one because: