I'm duplicating the linked issue because I can't reopen it. It is still here with the latest beta.
| Comment | File | Size | Author |
|---|---|---|---|
| #26 | contact_storage.patch | 2.43 KB | andrew answer |
| #22 | contact_storage-3053497-8-22-interdiff.txt | 424 bytes | rosk0 |
| #22 | contact_storage-3053497-22.patch | 2 KB | rosk0 |
| #17 | 3053497-17.png | 31.25 KB | kleiton_rodrigues |
| #8 | 3053497-8.patch | 1.75 KB | godotislate |
Issue fork contact_storage-3053497
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
berdirExcept it's not there for anyone else. Also, what does latest beta mean, there are stable releases now that you should use.
Provide the exact errors that you see and what you did, even if it looks the same, it is likely a different problem than the one fixed 3 years ago.
Comment #3
e.r.n.i.e commentedHere is what I did and the errors that followed:
Drupal version 8.8.5 on a local DEV-Environment.
Comment #4
mstef commentedGetting the same issue with core 8.9.6 and 8.x-1.1: #3172458: An error occurred while notifying the creation of the % field storage definition
Comment #5
mstef commentedTests are failing for 8.9.x: https://www.drupal.org/pift-ci-job/1533120
Comment #6
mstef commentedNot sure why drush is hiding the actual message, but here it is:
Cannot add field 'contact_message.id': table doesn't exist.(repeated for all 4 fields)Comment #7
mstef commentedSeems the base field hook is being invoked before the entity base table has been created. Patch adds a check before returning the additional fields.
Comment #8
godotislateCan confirm I'm seeing the same error on site install with Lightning 4.1.7, core 8.9.6 and Contact Storage 8.x-1.1.
Alternate fix is to move the
hook_install()implementation tohook_preinstall().Comment #9
perignon commentedThe patch in #8 fixes the problem as well as the patch in #7. I too am using lightning distro so I choose to try #8. But the lightning profile has nothing to do with this problem it is just that lightning requires this module. I only saw this error when I am doing a command line install of the site. Never saw the error in the UI.
Comment #10
berdirThat seems like a neat fix, seeing these errors now as well, I believe this is not actually a problem as the test also shows, because we do manually ensure that those are installed in our contact_storage_install().
One weird thing is that we still do that now in the preinstall() hook, and i guess core then also tries to do that again? Could we actually remove the call to _contact_storage_ensure_fields() as core should then do that for us? Might be worth a try? It doesn't fail right now, but maybe eventually, something will get confused when trying to instal already installed fields?
Comment #11
jibranNR for #10.
Comment #12
nikosnikos commentedTried patch #7 and it works for me. Drupal 9.1.5. Contact Storage 8.x-1.1.
Comment #13
kaszarobertPatch #8 fixes the errors during module install described in #3.
Comment #14
escuriola commentedPath #8 works for me too in a clean Drupal 9 with PHP 7.3
Comment #15
d70rr3s commentedAlso #8 working on 9.2 and PHP 7.4. Thanks!
Comment #16
kleiton_rodrigues commentedComment #17
kleiton_rodrigues commentedPatch #8 it works for me working on Drupal Version 8.9.9 and PHP 7.3.
RTBC +1
Comment #18
kleiton_rodrigues commentedComment #19
kleiton_rodrigues commentedComment #20
boobaaI can confirm that the patch in #8 also works in drupal-9.2.7 and solves the problem described in #3.
Comment #21
larowlan#10 asked for changes here
Comment #22
rosk0Addressing #10, if I understood it correctly.
Comment #23
mxr576I am also having troubles with understanding if that was the actual request by @berdir in #10, but it looks if that was it then it does not work. I also see no reason why "core would do that for us", but I could be wrong.
#8 still works on Drupal core 9.3.14
Comment #24
mxr576Comment #25
berdir> I also see no reason why "core would do that for us", but I could be wrong.
I'm talking about the code in ModuleInstaller that installs field definitions of another module.
And not sure what you mean by "then it does not work.", if you mean the failing test then that's unrelated and already fix in HEAD, so re-test of that should be green.
However, if we go in that direction then we don't need to change it to a preinstall hook and _only_have to remoe that extra line.
Comment #26
andrew answer commentedI fixed this bug using the alternate way. I was created the table in DB with hook_schema().
Comment #27
sagesolutions commentedI tested patch #26 on a clean install Drupal 9.5.3 with PHP 8.1.
Before, I was getting the following errors
After applying patch #26 The module installed properly with no errors.
Comment #28
aaronbaumanLooks like another duplicate issue, closed on this one.
#3330460: Fields cannot be created when installing
Comment #29
hyperlogos commentedPatch #26 works here
Comment #30
kleiton_rodrigues commentedPatch #26 RTBC +1
Comment #32
tonytheferg commented+1 for the patch in #26 Couldn't install the module through importing config without the schema.
Comment #33
andres.torres commented+1 for #26, Working on Drupal 10.2.6 fresh install.
Comment #34
inversed commented#26 works for me using existing config sync yaml on a fresh install.
Comment #35
berdirRebased and merged.
Comment #37
berdirComment #39
kopeboyIn which release can we find this?
Comment #40
marvs5 commentedI just installed contact storage 8.x-1.3 (1.3.0) on a site using composer. When I activated it via drush en contact_storage, I received the following error message:
[error] An error occurred while notifying the creation of the id field storage definition: "Exception thrown while performing a schema update. Cannot add field 'contact_message.id': table doesn't exist." in Drupal\Core\Entity\Sql\SqlContentEntityStorage->wrapSchemaException() (line 1601 of /web/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php).
[error] An error occurred while notifying the creation of the created field storage definition: "Exception thrown while performing a schema update. Cannot add field 'contact_message.created': table doesn't exist." in Drupal\Core\Entity\Sql\SqlContentEntityStorage->wrapSchemaException() (line 1601 of /web/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php).
[error] An error occurred while notifying the creation of the uid field storage definition: "Exception thrown while performing a schema update. Cannot add field 'contact_message.uid': table doesn't exist." in Drupal\Core\Entity\Sql\SqlContentEntityStorage->wrapSchemaException() (line 1601 of /web/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php).
[error] An error occurred while notifying the creation of the ip_address field storage definition: "Exception thrown while performing a schema update. Cannot add field 'contact_message.ip_address': table doesn't exist." in Drupal\Core\Entity\Sql\SqlContentEntityStorage->wrapSchemaException() (line 1601 of /web/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php).
[success] Successfully enabled: contact_storage