Order of module installation prevents proper access_policy field creation

Created on 30 November 2023, almost 2 years ago
Updated 7 December 2023, almost 2 years ago

Problem/Motivation

There is an issue appeared when I tried to install Menu Item Extras module β†’ on a site that already used access policy module as below:

In ExceptionHandler.php line 46:
                                                                                                                                                                                                                                                               
  SQLSTATE[42S02]: Base table or view not found: 1146 Table 'drupal10.menu_link_content__access_policy' doesn't exist: SELECT "t".*                                                                                                                            
  FROM                                                                                                                                                                                                                                                         
  "menu_link_content__access_policy" "t"                                                                                                                                                                                                                       
  WHERE ("entity_id" IN (:db_condition_placeholder_0, :db_condition_placeholder_1, :db_condition_placeholder_2, :db_condition_placeholder_3, :db_condition_placeholder_4, :db_condition_placeholder_5, :db_condition_placeholder_6, :db_condition_placeholder  
  _7)) AND ("deleted" = :db_condition_placeholder_8) AND ("langcode" IN (:db_condition_placeholder_9, :db_condition_placeholder_10, :db_condition_placeholder_11))                                                                                             
  ORDER BY "delta" ASC; Array                                                                                                                                                                                                                                  
  (                                                                                                                                                                                                                                                            
      [:db_condition_placeholder_0] => 5                                                                                                                                                                                                                       
      [:db_condition_placeholder_1] => 6                                                                                                                                                                                                                       
      [:db_condition_placeholder_2] => 7                                                                                                                                                                                                                       
      [:db_condition_placeholder_3] => 8                                                                                                                                                                                                                       
      [:db_condition_placeholder_4] => 9                                                                                                                                                                                                                       
      [:db_condition_placeholder_5] => 11                                                                                                                                                                                                                      
      [:db_condition_placeholder_6] => 12                                                                                                                                                                                                                      
      [:db_condition_placeholder_7] => 13                                                                                                                                                                                                                      
      [:db_condition_placeholder_8] => 0                                                                                                                                                                                                                       
      [:db_condition_placeholder_9] => en                                                                                                                                                                                                                      
      [:db_condition_placeholder_10] => und                                                                                                                                                                                                                    
      [:db_condition_placeholder_11] => zxx                                                                                                                                                                                                                    
  )                                                                                                                                                                                                                                                            
                                                                                                                                                                                                                                                               

In StatementWrapperIterator.php line 110:
                                                                                                                       
  SQLSTATE[42S02]: Base table or view not found: 1146 Table 'drupal10.menu_link_content__access_policy' doesn't exist

I'm not sure if this issue is related to access policy module or menu item extras module, but I solved the issue when I uninstall access policy module then install the menu item extras module first, so I think there is something trying to alter some tables or entities before the installation of menu item extras finish.

Steps to reproduce

1- Install access policy module.
2- Install menu item extras module.
3- The above error will appear.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡―πŸ‡΄Jordan Odai Atieh Amman

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024