Skip to content

Duplicate CustomerNavigationBar in CustomerTicketMessage.pm on validation error #5078

Description

@kuwadigital

Environment

  • Server OS Distribution: Ubuntu 22.04 LTS
  • OTOBO installation type: Docker
  • Browser: All browsers (Chrome, Firefox, Safari)
  • OTOBO version: 11.0.x

Expected behavior

When a customer submits the new ticket form (CustomerTicketMessage) with validation errors, the customer navigation bar should be displayed only once and the expand button schould work correctly.

Actual behavior

The customer navigation bar is rendered twice on the page when the form submission fails due to validation errors (e.g., missing required fields).

How to reproduce

Steps to reproduce the behavior:

  1. In the Agent Interface, deactivate all Ticket-Fields (Queues, Services ...) and keep only the Subject and RichText
  2. Go to the Customer Interface
  3. Click on "New Ticket" (CustomerTicketMessage)
  4. Leave required fields empty (e.g., Subject or Body)
  5. Click "Submit"
  6. Observe the page with validation errors
  7. The navigation bar appears twice on the page (can be find out by analysing in the console of the navigator)
  8. The Navigation is not reacting anymore when we the user try to expand the NavigationBar

Additional information

The issue is located in Kernel/Modules/CustomerTicketMessage.pm in the StoreNew subaction error handling block (around lines 819-848).

The code currently calls CustomerNavigationBar() twice:

if (%Error) {                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                               
    # html output                                                                                                                                                                                                                                                              
    my $Output = $LayoutObject->CustomerHeader();                                                                                                                                                                                                                              
                                                                                                                                                                                                                                                                               
    if ( $Error{QueueDisabled} ) {                                                                                                                                                                                                                                             
        $Output .= $LayoutObject->Notify(                                                                                                                                                                                                                                      
            Priority => 'Error',                                                                                                                                                                                                                                               
            Info     => Translatable("You don't have sufficient permissions for ticket creation in default queue."),                                                                                                                                                           
        );                                                                                                                                                                                                                                                                     
    }                                                                                                                                                                                                                                                                          
                                                                                                                                                                                                                                                                               
    $Output .= $LayoutObject->CustomerNavigationBar();  # <-- First call (line ~831)                                                                                                                                                                                           
    $Output .= $Self->_MaskNew(                                                                                                                                                                                                                                                
        # ... parameters ...                                                                                                                                                                                                                                                   
    );                                                                                                                                                                                                                                                                         
    $Output .= $LayoutObject->CustomerNavigationBar();  # <-- Second call (line ~843)                                                                                                                                                                                          
    $Output .= $LayoutObject->CustomerFooter();                                                                                                                                                                                                                                
                                                                                                                                                                                                                                                                               
    return $Output;                                                                                                                                                                                                                                                            
}                                                                                                                                                                                                                                                                              

Suggested fix: Remove the first CustomerNavigationBar() call (before _MaskNew()) to be consistent with the non-error display flow (lines 516-530) which only calls CustomerNavigationBar() once, after _MaskNew().

Screenshots

1- New Ticket Form after removing other Fields:

Image

2- View after submitting an empty form:

Image

3- View of the console of the navigator:

Image

Metadata

Metadata

Assignees

Labels

bugSomething isn't working as intended

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions