Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed processing of NavBarModule for process tickets and submenus #463

Open
wants to merge 6 commits into
base: dev
Choose a base branch
from

Conversation

tipue-dev
Copy link
Contributor

@tipue-dev tipue-dev commented Jul 20, 2023

Proposed change

EDIT: Extended the fix.
The customer frontend in Znuny 7 changed in a way that there are no sub menus by default anymore. The processing of NavBarModule for process tickets doesn't work correctly after this change.
It adds an 'empty' menu entry that is clickable and will be highlighted on mouse over.
image

This problem was also the reason for the bug #355. This bug has been fixed by hiding the wrongly created empty sub menus.
My fix stops the creation of the wrong submenus, so i also reverted the fix for that problem and added some css, so that sub menus now work normally and in a small window.

image
image

This all is because the entry for process tickets isn't deleted correctly and the NavBarModule-hash get's a bit scrambled up.
Before the NavBarModule for process tickets is checked it looks like this:

Kernel::Output::HTML::Layout::CustomerNavigationBar Line:4613';
%NavBarModule = {
                    '0000010' => {
                                   'AccessKey' => 'o',
                                   'Block' => '',
                                   'Description' => 'Create new process ticket.',
                                   'Group' => [],
                                   'GroupRo' => [],
                                   'Link' => 'Action=CustomerTicketProcess',
                                   'LinkOption' => '',
                                   'Name' => 'Create Process Ticket',
                                   'NavBar' => 'Ticket',
                                   'Prio' => '0010',
                                   'Type' => 'Menu'
                                 },
                    '0000100' => {
                                   'AccessKey' => 'n',
                                   'Block' => '',
                                   'Description' => 'Create new Ticket.',
                                   'Group' => [],
                                   'GroupRo' => [],
                                   'Link' => 'Action=CustomerTicketMessage',
                                   'LinkOption' => '',
                                   'Name' => 'Create Ticket',
                                   'NavBar' => 'Ticket',
                                   'Prio' => 100,
                                   'Type' => 'Menu'
                                 },
                    '0000101' => {
                                   'AccessKey' => 'm',
                                   'Block' => '',
                                   'Description' => 'Tickets.',
                                   'Group' => [],
                                   'GroupRo' => [],
                                   'Link' => 'Action=CustomerTicketOverview;Subaction=MyTickets',
                                   'LinkOption' => '',
                                   'Name' => 'My Tickets',
                                   'NavBar' => 'Ticket',
                                   'Prio' => 101,
                                   'Type' => 'Menu'
                                 },
                    '0000120' => {
                                   'AccessKey' => 't',
                                   'Block' => '',
                                   'Description' => 'Company Tickets.',
                                   'Group' => [],
                                   'GroupRo' => [],
                                   'Link' => 'Action=CustomerTicketOverview;Subaction=CompanyTickets',
                                   'LinkOption' => '',
                                   'Name' => 'Company Tickets',
                                   'NavBar' => 'Ticket',
                                   'Prio' => 120,
                                   'Type' => 'Menu'
                                 },
                    '0000300' => {
                                   'AccessKey' => 's',
                                   'Block' => '',
                                   'Description' => 'Search tickets.',
                                   'Group' => [],
                                   'GroupRo' => [],
                                   'Link' => 'Action=CustomerTicketSearch',
                                   'LinkOption' => '',
                                   'Name' => 'Ticket Search',
                                   'NavBar' => 'Ticket',
                                   'Prio' => 300,
                                   'Type' => 'Menu'
                                 },
                    '0000710' => {
                                   'AccessKey' => 'x',
                                   'Block' => '',
                                   'Description' => 'FAQ Explorer',
                                   'Group' => [],
                                   'GroupRo' => [],
                                   'Link' => 'Action=CustomerFAQExplorer',
                                   'LinkOption' => '',
                                   'Name' => 'FAQ Explorer',
                                   'NavBar' => 'FAQ',
                                   'Prio' => 710,
                                   'Type' => 'Menu'
                                 },
                    '0000780' => {
                                   'AccessKey' => 'f',
                                   'Block' => '',
                                   'Description' => 'FAQ Search',
                                   'Group' => [],
                                   'GroupRo' => [],
                                   'Link' => 'Action=CustomerFAQSearch',
                                   'LinkOption' => '',
                                   'Name' => 'FAQ Search',
                                   'NavBar' => 'FAQ',
                                   'Prio' => 780,
                                   'Type' => 'Menu'
                                 }
                  };

After the NavBarModule for process tickets tries to delete the entry for process tickets:

Kernel::Output::HTML::Layout::CustomerNavigationBar Line:4643';
%NavBarModule = {
                    '0000010' => {
                                   '0000010' => {
                                                  'AccessKey' => 'o',
                                                  'Block' => '',
                                                  'Description' => 'Create new process ticket.',
                                                  'Group' => [],
                                                  'GroupRo' => [],
                                                  'Link' => 'Action=CustomerTicketProcess',
                                                  'LinkOption' => '',
                                                  'Name' => 'Create Process Ticket',
                                                  'NavBar' => 'Ticket',
                                                  'Prio' => '0010',
                                                  'Type' => 'Menu'
                                                },
                                   '0000100' => {
                                                  'AccessKey' => 'n',
                                                  'Block' => '',
                                                  'Description' => 'Create new Ticket.',
                                                  'Group' => [],
                                                  'GroupRo' => [],
                                                  'Link' => 'Action=CustomerTicketMessage',
                                                  'LinkOption' => '',
                                                  'Name' => 'Create Ticket',
                                                  'NavBar' => 'Ticket',
                                                  'Prio' => 100,
                                                  'Type' => 'Menu'
                                                },
                                   '0000101' => {
                                                  'AccessKey' => 'm',
                                                  'Block' => '',
                                                  'Description' => 'Tickets.',
                                                  'Group' => [],
                                                  'GroupRo' => [],
                                                  'Link' => 'Action=CustomerTicketOverview;Subaction=MyTickets',
                                                  'LinkOption' => '',
                                                  'Name' => 'My Tickets',
                                                  'NavBar' => 'Ticket',
                                                  'Prio' => 101,
                                                  'Type' => 'Menu'
                                                },
                                   '0000120' => {
                                                  'AccessKey' => 't',
                                                  'Block' => '',
                                                  'Description' => 'Company Tickets.',
                                                  'Group' => [],
                                                  'GroupRo' => [],
                                                  'Link' => 'Action=CustomerTicketOverview;Subaction=CompanyTickets',
                                                  'LinkOption' => '',
                                                  'Name' => 'Company Tickets',
                                                  'NavBar' => 'Ticket',
                                                  'Prio' => 120,
                                                  'Type' => 'Menu'
                                                },
                                   '0000300' => {
                                                  'AccessKey' => 's',
                                                  'Block' => '',
                                                  'Description' => 'Search tickets.',
                                                  'Group' => [],
                                                  'GroupRo' => [],
                                                  'Link' => 'Action=CustomerTicketSearch',
                                                  'LinkOption' => '',
                                                  'Name' => 'Ticket Search',
                                                  'NavBar' => 'Ticket',
                                                  'Prio' => 300,
                                                  'Type' => 'Menu'
                                                },
                                   '0000710' => {
                                                  'AccessKey' => 'x',
                                                  'Block' => '',
                                                  'Description' => 'FAQ Explorer',
                                                  'Group' => [],
                                                  'GroupRo' => [],
                                                  'Link' => 'Action=CustomerFAQExplorer',
                                                  'LinkOption' => '',
                                                  'Name' => 'FAQ Explorer',
                                                  'NavBar' => 'FAQ',
                                                  'Prio' => 710,
                                                  'Type' => 'Menu'
                                                },
                                   '0000780' => {
                                                  'AccessKey' => 'f',
                                                  'Block' => '',
                                                  'Description' => 'FAQ Search',
                                                  'Group' => [],
                                                  'GroupRo' => [],
                                                  'Link' => 'Action=CustomerFAQSearch',
                                                  'LinkOption' => '',
                                                  'Name' => 'FAQ Search',
                                                  'NavBar' => 'FAQ',
                                                  'Prio' => 780,
                                                  'Type' => 'Menu'
                                                },
                                   'Ticket' => {}
                                 },
%NavBarModule->{'0000010'}{'0000100'},
%NavBarModule->{'0000010'}{'0000101'},
%NavBarModule->{'0000010'}{'0000120'},
%NavBarModule->{'0000010'}{'0000300'},
%NavBarModule->{'0000010'}{'0000710'},
%NavBarModule->{'0000010'}{'0000780'},
%NavBarModule->{'0000010'}=> $
                  };

With this fix, the entry get's deleted correctly:

Kernel::Output::HTML::Layout::CustomerNavigationBar Line:4640';
%NavBarModule = {
                    '0000100' => {
                                   'AccessKey' => 'n',
                                   'Block' => '',
                                   'Description' => 'Create new Ticket.',
                                   'Group' => [],
                                   'GroupRo' => [],
                                   'Link' => 'Action=CustomerTicketMessage',
                                   'LinkOption' => '',
                                   'Name' => 'Create Ticket',
                                   'NavBar' => 'Ticket',
                                   'Prio' => 100,
                                   'Type' => 'Menu'
                                 },
                    '0000101' => {
                                   'AccessKey' => 'm',
                                   'Block' => '',
                                   'Description' => 'Tickets.',
                                   'Group' => [],
                                   'GroupRo' => [],
                                   'Link' => 'Action=CustomerTicketOverview;Subaction=MyTickets',
                                   'LinkOption' => '',
                                   'Name' => 'My Tickets',
                                   'NavBar' => 'Ticket',
                                   'Prio' => 101,
                                   'Type' => 'Menu'
                                 },
                    '0000120' => {
                                   'AccessKey' => 't',
                                   'Block' => '',
                                   'Description' => 'Company Tickets.',
                                   'Group' => [],
                                   'GroupRo' => [],
                                   'Link' => 'Action=CustomerTicketOverview;Subaction=CompanyTickets',
                                   'LinkOption' => '',
                                   'Name' => 'Company Tickets',
                                   'NavBar' => 'Ticket',
                                   'Prio' => 120,
                                   'Type' => 'Menu'
                                 },
                    '0000300' => {
                                   'AccessKey' => 's',
                                   'Block' => '',
                                   'Description' => 'Search tickets.',
                                   'Group' => [],
                                   'GroupRo' => [],
                                   'Link' => 'Action=CustomerTicketSearch',
                                   'LinkOption' => '',
                                   'Name' => 'Ticket Search',
                                   'NavBar' => 'Ticket',
                                   'Prio' => 300,
                                   'Type' => 'Menu'
                                 },
                    '0000710' => {
                                   'AccessKey' => 'x',
                                   'Block' => '',
                                   'Description' => 'FAQ Explorer',
                                   'Group' => [],
                                   'GroupRo' => [],
                                   'Link' => 'Action=CustomerFAQExplorer',
                                   'LinkOption' => '',
                                   'Name' => 'FAQ Explorer',
                                   'NavBar' => 'FAQ',
                                   'Prio' => 710,
                                   'Type' => 'Menu'
                                 },
                    '0000780' => {
                                   'AccessKey' => 'f',
                                   'Block' => '',
                                   'Description' => 'FAQ Search',
                                   'Group' => [],
                                   'GroupRo' => [],
                                   'Link' => 'Action=CustomerFAQSearch',
                                   'LinkOption' => '',
                                   'Name' => 'FAQ Search',
                                   'NavBar' => 'FAQ',
                                   'Prio' => 780,
                                   'Type' => 'Menu'
                                 }
                  };

1 - 🐞 bug 🐞

Breaking change

I removed the return of the menu entries, since they are passed as a reference anyways. This might be a breaking change if there are NavBarModule in use that i don't know about, but they would likely also create ghost entries and would have to be changed.

Checklist

  • The code change is tested and works locally.(❗)
  • There is no commented out code in this PR.(❕)
  • You improved or added new unit tests.(❕)
  • Local ZnunyCodePolicy passed.(❕)
  • Local UnitTests / Selenium passed.(❕)
  • GitHub workflow CI (UnitTests / Selenium) passed.(❗)

@tipue-dev tipue-dev changed the title fixed processing of NavBarModule for process tickets Fixed processing of NavBarModule for process tickets and submenus Jul 21, 2023
@NiklasSchmitt NiklasSchmitt added 1 - 🐞 bug 🐞 An issue with the system. 4 - verified This issue or pull request was verified. labels Nov 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1 - 🐞 bug 🐞 An issue with the system. 4 - verified This issue or pull request was verified.
Development

Successfully merging this pull request may close these issues.

None yet

4 participants