Score:1

Fatal error: Cannot redeclare Drupal\views\Routing\ViewPageController::getTitle()

gh flag

I have updated Drupal 9.0.1 to 9.2.2 via Composer. After updating, I am getting a fatal error.

Fatal error: Cannot redeclare Drupal\views\Routing\ViewPageController::getTitle() in /var/www/html/docroot/core/modules/views/src/Routing/ViewPageController.php on line 98

drush updb outputs the following.

 -------- ------------------ ------------- ------------------------------------ 
  Module   Update ID          Type          Description                         
 -------- ------------------ ------------- ------------------------------------ 
  file     add_txt_if_allow   post-update   Add txt to allowed extensions for   
           s_insecure_exten                 all fields that allow uploads of    
           sions                            insecure files.                     
  system   delete_rss_setti   post-update   Remove obsolete system.rss          
           ngs                              configuration.                      
  system   remove_key_value   post-update   Drop the 'all' index on the         
           _expire_all_inde                 'key_value_expire' table.           
           x                                                                    
  system   service_advisory   post-update   Add new security advisory           
           _settings                        retrieval settings.                 
  tour     joyride_selector   post-update   Convert Joyride selectors to        
           s_to_selector_pr                 `selector` property.   @see         
           operty                           tour_tour_presave()                 
  views    rename_default_d   post-update   Rename the setting for showing the  
           isplay_setting                   default display to                  
                                            'default_display'.                  
  views    title_translatio   post-update   Rebuild routes to fix view title    
           ns                               translations.                       
 -------- ------------------ ------------- ------------------------------------ 

Do you wish to run the specified pending updates? (yes/no) [yes]:
> [notice] Module kint has an entry in the system.schema key/value storage, but is missing from your site. 
> [notice] Update started: file_post_update_add_txt_if_allows_insecure_extensions
> [notice] Update completed: file_post_update_add_txt_if_allows_insecure_extensions
> [notice] Update started: system_post_update_delete_rss_settings
> [notice] Update completed: system_post_update_delete_rss_settings
> [notice] Update started: system_post_update_remove_key_value_expire_all_index
> [notice] Update completed: system_post_update_remove_key_value_expire_all_index
> [notice] Update started: system_post_update_service_advisory_settings
> [notice] Update completed: system_post_update_service_advisory_settings
> [notice] Update started: tour_post_update_joyride_selectors_to_selector_property
> [notice] Update completed: tour_post_update_joyride_selectors_to_selector_property
> [notice] Update started: views_post_update_rename_default_display_setting
> [notice] Update completed: views_post_update_rename_default_display_setting
> [notice] Update started: views_post_update_title_translations
> [notice] Update completed: views_post_update_title_translations
> PHP Fatal error:  Cannot redeclare Drupal\views\Routing\ViewPageController::getTitle() in /var/www/html/docroot/core/modules/views/src/Routing/ViewPageController.php on line 98> 
> [warning] Drush command terminated abnormally.

In ProcessBase.php line 171:
                                                                                                                                                                               
  Unable to decode output into JSON: Syntax error                                                                                                                              
                                                                                                                                                                               
  Fatal error: Cannot redeclare Drupal\views\Routing\ViewPageController::getTitle() in /var/www/html/docroot/core/modules/views/src/Routing/ViewPageController.php on line 98

Any hint will be appreciated.

misterdidi avatar
de flag
How did you upgrade Drupal? Manual update or update via Composer?
Md Eqbal Ahmad avatar
gh flag
@misterdidi via composer> composer update drupal/core "drupal/core-*" --with-all-dependencies
Score:1
gh flag

Issue got resolved. There was a patch which was already implemeted. and 9.2.* has incorporated the same in drupal core. So removing the patch has fixed the issue

View titles in breadcrumb and metatag title don't get properly translated

Oleksandr Berezko avatar
ng flag
Thanks so much for sharing this! Saved me many hours.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.