Closed (fixed)
Project:
Pathauto
Version:
8.x-1.0-alpha2
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
30 Mar 2016 at 12:16 UTC
Updated:
2 May 2016 at 18:54 UTC
Jump to comment: Most recent
After installing pathauto I can access the admin pages, set up patterns. But as soon as I tray to bulk generate or manually generate a single alias (edit node and save it) I get an exception. error.log says the url_alias table is missing (and it is). Am I missing something? Used the module quite a lot in D6/D7 though...
Comments
Comment #2
thommyboy commentedHm- as url_alias is part of Core (?) I uninstalled the module and added a manual alias. This worked and I now see the url_alias table and after re-installing pathauto it works perfectly now. Maybe the table gets only generated at first use?!
Comment #3
sharique commentedThe url_alias table is still there, there is something wrong with your installation of module, try uninstall and install module again, this should fix it.
Did you get any error when trying to install module?
Comment #4
thommyboy commentedno errors on installation- on a clean D8! I just added some nodes, did NOT use url aliases and then installed pathauto with the given problem.
I got the following errors when USING pathauto (bulk or just checkbox on a single node and trying to save the node)
As said- after deinstalling and manually saving an alias and re-installing everything is fine now
Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'ABC.url_alias' doesn't exist: SELECT pid FROM {url_alias} WHERE source = :source AND langcode IN (:language, :language_none) ORDER BY langcode DESC, pid DESC LIMIT 0, 1; Array ( [:source] => /node/5 [:language] => de [:language_none] => und ) in Drupal\pathauto\AliasStorageHelper->loadBySource() (Zeile 163
Comment #5
berdirYes, core moved that so it's now auto-created. Which is a problem as we're doing queries against it.
Not sure yet what to do. #2672150: Use alias manager and storage services instead of custom queries against url_alias for a start, and if we still have queries then, we could auto-create it too.
Comment #6
dave reidWhat?? This behavior sounds insane. We should trigger the table creation whenever Pathauto is installed. How do we trigger that?
Comment #7
berdirI guess we can do that as a workaround at least yes.
The table is part of the service now, we do that for a few tables that are meant to be completely abstracted by a service. The service auto-creates it when accessed (with some tricks, catches exception, checks table and then re-tries).
Which for some makes sense, as a service replacement then doesn't have to create the table.
However, the implementation here seems weird. It will only create the table on save, that means every request will throw and catch an exception but not create the table until you actually create an alias. That has to be a performance problem?
Comment #8
alexpottI've created #2704821: url_alias table should be created by system install to create the url_alias storage again on system install. However as @Berdir said in IRC
I think we need to add some hook_requirements to pathauto to check that both the alias storage and entity storage are using core's defaults.
Comment #9
dave reidThis should be resolved in the meantime with #2705937: Ensure the url_alias table is created when the module is installed for anyone using an affected version of Drupal core with this bug.