Problem/Motivation
After upgrading the site to 8.9.13 any new content creation gives an error and doesn't complete. Editing content is ok. I updated to latest version to resolve FontYourFace module not working, giving ajax errors. The upgrade didn't resolve the FontYourFace issues and resulted in this critical error that has crippled my site.
Steps to reproduce
The issue seems to be with the path_alias table. Creating any content after upgrading core to 8.9.13 errors out on new content save. Preview works, but not save. The logged error is:
Drupal\Core\Entity\EntityStorageException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'legionofmary.url_alias' doesn't exist: SELECT pid FROM {url_alias} WHERE alias = :alias AND source != :source; Array ( [:alias] => /page/ministry [:source] => /node/36 ) in Drupal\Core\Entity\Sql\SqlContentEntityStorage->save() (line 846 of /home/mediaq/legionofmarysac.dreamhosters.com/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php).
Proposed resolution
None of the solutions provided for this error in general Drupal support chatter (all dated end of 2019) seem to work to resolve this. None of the database update suggestions resolved this for me.
Remaining tasks
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | 3203893-10.patch | 629 bytes | drupalninja99 |
Comments
Comment #2
Code Monkey commentedYou didn't state which version you were upgrading from. I'm not sure if it matters though. See the patch here to see if it resolves this issue.
Comment #3
hondaman900 commentedThanks Code Monkey, I didn't explicitly mention the version because I had selected the version of OpenChurch as part of the post profile (8.x-2.3).
I applied this patch and it seems to have resolved the issue in that I can save new content and am not getting the error - many thanks!
I would advocate that this patch be implemented in the distribution code.
Comment #4
Code Monkey commentedMy mistake on the versioning. I hadn't looked at this in a while.
Comment #5
hondaman900 commentedUnfortunately, this issue is not quite resolved. While I can save new content, updating existing content and adding any form of relative link causes the same issue. For example, when I change the OpenChurch Homepage Featured block and add links, it bombs with the same "The website encountered an unexpected error. Please try again later." message. No relative link at all will work, only a full path or a blank field works. The logs show the following error:
InvalidArgumentException: The URI '<front>' is invalid. You must use a valid URI scheme. in Drupal\Core\Url::fromUri() (line 290 of /home/mediaq/legionofmarysac.dreamhosters.com/core/lib/Drupal/Core/Url.php).Is there an additional patch for the
url.phpfile perhaps?Please advise
Comment #6
Code Monkey commentedI'm not certain this is it , but it is worth a look.
In your settings.php file, what is this setting set to? $settings['file_public_base_url']
I do not need to know the answer. However, is it set correctly?
Comment #7
warped commentedApplied to 9.4.5 and updated existing content. Messages from watchdog:
Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException: You have requested a non-existent service "path.alias_storage". in Drupal\Component\DependencyInjection\Container-
Drupal\Core\Entity\EntityStorageException: You have requested a non-existent service "path.alias_storage". in Drupal\Core\Entity\Sql\SqlContentEntityStorage->save() (line 811 of /var/www/h
Comment #8
warped commentedHere is the quick change I did when 8.0.0 url_alias to path_alias broke my site.
I understand the need for using proper abstraction thru APIs, Dependency Injection, etc.
This is posted to add to the discussion.
It worked in D8. I have not tested it in D9 yet.
When searching for a solution I came across this:
https://www.drupal.org/project/entity_legal/issues/3182420
< $alias_exists = db_query('SELECT pid FROM {url_alias}
< WHERE alias = :alias AND source != :source',
---
> $alias_exists = db_query('SELECT id FROM {path_alias}
> WHERE alias = :alias AND path != :source',
Comment #9
warped commentedA few lines under the patch there was another deprecated section:
That needed to be replaced. I used the following:
Drupal v9.4.7 PHP v7.4.32 Comments? Language code should probably reflect the node.
Comment #10
drupalninja99 commentedThis patch fixes the issue
Comment #12
drupalninja99 commentedAdded a new release, thanks for your help! I was able to install successfully after applying this fix.