Jun 9, 2014

Issue: Uninstalling a module in the presence of a shortcut for it

When I started working on the .install script, I first tried to uninstall the module. This completely broke the site and made it unusable. Only a page with an error message would be displayed no matter what path I tried. The message stated that a RouteNotFoundException was thrown for route optimizely.add_update.

The full error message is:
Symfony\Component\Routing\Exception\RouteNotFoundException:
Route "optimizely.add_update" does not exist.
in Drupal\Core\Routing\RouteProvider->getRouteByName()
(line 150 of core\lib\Drupal\Core\Routing\RouteProvider.php). 
Searching through the database, I found a row in table shortcut that referred to that route. After deleting the row, the site worked fine.

I don't remember creating such a shortcut - I didn't even know about shortcuts before this problem happened - and don't know how it came into being.

But I was able to reproduce this by manually adding a shortcut for the path to one of the Optimizely tabs, then uninstalling the module. The same error message came up.

I haven't found any recourse other than to go into the database to delete the shortcut from the shortcut table.

The first article below reports this issue along with a recent attempt to fix this in core.

Sources:

RouteNotFoundException when a module (previously added to shortcuts) disabled
https://drupal.org/node/2266325

Working with the shortcut bar
https://drupal.org/documentation/modules/shortcut




1 comment:

  1. The only case where a path alias is created automatically in D7 is when the pathauto module is enabled:
    https://drupal.org/documentation/modules/pathauto

    or perhaps a custom alias path was added via the admin interface. I look forward to getting a better understanding how the `shortcut` entry happened.

    ReplyDelete