Uninstall issue

Created on 21 July 2019, almost 6 years ago
Updated 6 September 2023, over 1 year ago

When i try to uninstall the module i get this error:

Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'test.menu_link_content__menu_item_roles' doesn't exist: SELECT t.* FROM {menu_link_content__menu_item_roles} 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)) AND (deleted = :db_condition_placeholder_5) AND (langcode IN (:db_condition_placeholder_6, :db_condition_placeholder_7, :db_condition_placeholder_8, :db_condition_placeholder_9)) ORDER BY delta ASC; Array ( [:db_condition_placeholder_0] => 3 [:db_condition_placeholder_1] => 6 [:db_condition_placeholder_2] => 7 [:db_condition_placeholder_3] => 8 [:db_condition_placeholder_4] => 9 [:db_condition_placeholder_5] => 0 [:db_condition_placeholder_6] => en [:db_condition_placeholder_7] => ar [:db_condition_placeholder_8] => und [:db_condition_placeholder_9] => zxx ) in Drupal\Core\Entity\Sql\SqlContentEntityStorage->loadFromDedicatedTables() (line 1266 of /var/www/html/test/web/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php).

🐛 Bug report
Status

Active

Version

1.0

Component

Code

Created by

🇯🇴Jordan ahmad abbad Jordan

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇧🇬Bulgaria alexander.nachev

    Full nonsense. Installed and the site immediately crashed. Trying to uninstall it also crashes the site.
    I had to rebuild what it wanted in the DB to be able to uninstall this module.

    I had to add a column:
    ALTER TABLE `menu_link_content_data` ADD `menu_item_override_children` INT NOT NULL AFTER `revision_translation_affected`;

    and create 2 tables with blank columnts which are attached here

  • Status changed to Closed: cannot reproduce 9 months ago
  • 🇬🇧United Kingdom littlepixiez

    I've just tested this on a blank install of Drupal 8 and I also cannot replicate this. Whether it was a particular issue with Drupal 8 at the time and a misconfiguration between core's "Menu Link Content" and the 1.x-dev version of Menu Item Role Access is difficult to replicate and I cannot find any specific versions of core or this module mentioned in the comment thread.

    In any case, as Drupal 8 is end of life now and the 1.x-dev version requires it...:
    "drupal/core": "^8"
    The 2.x version is released now and is the recommended version. I'd imagine if nobody is getting this issue any more (as we've had no activity for 11 months now), we can safely close this issue as "Cannot reproduce", unless we get more information and then another issue can be created.

  • 🇳🇬Nigeria chike Nigeria

    I just installed on Drupal 10.3.10 and it won't uninstall. Luckily I took a db dump before installing so I have to roll back the site.

  • 🇫🇷France o'briat Nantes

    Hi,

    I reproduce with 8.x-2. + Drupal 10.4.3

    drush pmu menu_item_role_access
    
    In ExceptionHandler.php line 56:
    
      SQLSTATE[42S02]: Base table or view not found: 1146 Table 'db.menu_link_content_revision__menu_item_roles' doesn't exist: SELECT 1 AS "expression"
      FROM
      "menu_link_content_revision__menu_item_roles" "t"
      WHERE "menu_item_roles_target_id" IS NOT NULL
      LIMIT 1 OFFSET 0; Array
      (
      )
    
    
    In StatementWrapperIterator.php line 113:
    
      SQLSTATE[42S02]: Base table or view not found: 1146 Table 'db.menu_link_content_revision__menu_item_roles' doesn't exist
    
    
    
    Failed to run drush pmu menu_item_role_access: exit status 1
    

    I also have a error on menu item creation:

    Drupal\Core\Entity\EntityStorageException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'db.menu_link_content__menu_item_roles' doesn't exist: INSERT INTO "menu_link_content__menu_item_roles" ("entity_id", "revision_id", "bundle", "delta", "langcode", "menu_item_roles_target_id") VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5), (:db_insert_placeholder_6, :db_insert_placeholder_7, :db_insert_placeholder_8, :db_insert_placeholder_9, :db_insert_placeholder_10, :db_insert_placeholder_11); Array ( [:db_insert_placeholder_0] => 1 [:db_insert_placeholder_1] => 1 [:db_insert_placeholder_2] => menu_link_content [:db_insert_placeholder_3] => 0 [:db_insert_placeholder_4] => fr [:db_insert_placeholder_5] => administrator [:db_insert_placeholder_6] => 1 [:db_insert_placeholder_7] => 1 [:db_insert_placeholder_8] => menu_link_content [:db_insert_placeholder_9] => 1 [:db_insert_placeholder_10] => fr [:db_insert_placeholder_11] => sgami ) in Drupal\Core\Entity\Sql\SqlContentEntityStorage->save() (line 817 of core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php).
    
    Drupal\Core\Database\StatementWrapperIterator->execute() (Line: 44)
    Drupal\mysql\Driver\Database\mysql\Insert->execute() (Line: 1400)
    Drupal\Core\Entity\Sql\SqlContentEntityStorage->saveToDedicatedTables() (Line: 971)
    Drupal\Core\Entity\Sql\SqlContentEntityStorage->doSaveFieldItems() (Line: 718)
    Drupal\Core\Entity\ContentEntityStorageBase->doSave() (Line: 486)
    Drupal\Core\Entity\EntityStorageBase->save() (Line: 806)
    Drupal\Core\Entity\Sql\SqlContentEntityStorage->save() (Line: 354)
    Drupal\Core\Entity\EntityBase->save() (Line: 148)
    Drupal\menu_link_content\Form\MenuLinkContentForm->save()
    call_user_func_array() (Line: 129)
    Drupal\Core\Form\FormSubmitter->executeSubmitHandlers() (Line: 67)
    Drupal\Core\Form\FormSubmitter->doSubmitForm() (Line: 597)
    Drupal\Core\Form\FormBuilder->processForm() (Line: 326)
    Drupal\Core\Form\FormBuilder->buildForm() (Line: 48)
    Drupal\Core\Entity\EntityFormBuilder->getForm() (Line: 28)
    Drupal\menu_link_content\Controller\MenuController->addLink()
    call_user_func_array() (Line: 123)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 638)
    Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 121)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext() (Line: 97)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 181)
    Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 76)
    Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 53)
    Drupal\Core\StackMiddleware\Session->handle() (Line: 48)
    Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 28)
    Drupal\Core\StackMiddleware\ContentLength->handle() (Line: 32)
    Drupal\big_pipe\StackMiddleware\ContentLength->handle() (Line: 116)
    Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 90)
    Drupal\page_cache\StackMiddleware\PageCache->handle() (Line: 48)
    Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51)
    Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 36)
    Drupal\Core\StackMiddleware\AjaxPageState->handle() (Line: 51)
    Drupal\Core\StackMiddleware\StackedHttpKernel->handle() (Line: 741)
    Drupal\Core\DrupalKernel->handle() (Line: 19)
    

    For the record, menu_item_role_access_entity_base_field_info doesn't seems to create the menu_link_content__menu_item_roles table.

  • 🇫🇷France o'briat Nantes

    I notice that the problem is solved if you install it manually instead of using config import, the table is now present.
    Maybe there something missing in the install process or config export, hook_entity_base_field_info seems not to be executed by config import ?

    For the record you have to uninstall the module by hacking thecore.extension config and install it again manually:

    drush eval "\$module_data = \Drupal::config('core.extension')->get('module'); unset(\$module_data['menu_item_role_access']); \Drupal::configFactory()->getEditable('core.extension')->set('module', \$module_data)->save();"
    drush cr
    drush en menu_item_role_access -y
    
    
    drush sqlq "SHOW TABLES LIKE '%menu_item_roles';"
    menu_link_content__menu_item_roles
    menu_link_content_revision__menu_item_roles
    
  • 🇮🇹Italy apaderno Brescia, 🇮🇹

    Did anybody check the issue is still present in the 8.x-2.x branch?

    Comment #13 🐛 Uninstall issue Active seems to suggest creating a new issue, if somebody is able to reproduce the issue described here.

  • I have created a new issue and proposed a solution by implementing a hook_install which update field definition of menu_link_content.
    https://www.drupal.org/project/menu_item_role_access/issues/3524769 🐛 Missing hook_install to update field storage definition for menu_link_content Active

    The solution works fine in my test case.

Production build 0.71.5 2024