I'm duplicating the linked issue because I can't reopen it. It is still here with the latest beta.

Command icon 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

durum created an issue. See original summary.

berdir’s picture

Version: 8.x-1.0-beta10 » 8.x-1.x-dev
Status: Active » Postponed (maintainer needs more info)

Except 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.

e.r.n.i.e’s picture

Here is what I did and the errors that followed:

<strong>$ composer require drupal/contact_storage</strong>
Using version ^1.1 for drupal/contact_storage
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 1 install, 0 updates, 0 removals
  - Installing drupal/contact_storage (1.1.0): Downloading (100%)
Package container-interop/container-interop is abandoned, you should avoid using it. Use psr/container instead.
Package zendframework/zend-diactoros is abandoned, you should avoid using it. Use laminas/laminas-diactoros instead.
Package zendframework/zend-escaper is abandoned, you should avoid using it. Use laminas/laminas-escaper instead.
Package zendframework/zend-feed is abandoned, you should avoid using it. Use laminas/laminas-feed instead.
Package zendframework/zend-stdlib is abandoned, you should avoid using it. Use laminas/laminas-stdlib instead.
Writing lock file
Generating autoload files
5 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
Scaffolding files for drupal/core:
  - Copy [project-root]/.editorconfig from assets/scaffold/files/editorconfig
  - Copy [project-root]/.gitattributes from assets/scaffold/files/gitattributes
  - Copy [web-root]/.csslintrc from assets/scaffold/files/csslintrc
  - Copy [web-root]/.eslintignore from assets/scaffold/files/eslintignore
  - Copy [web-root]/.eslintrc.json from assets/scaffold/files/eslintrc.json
  - Copy [web-root]/.ht.router.php from assets/scaffold/files/ht.router.php
  - Copy [web-root]/.htaccess from assets/scaffold/files/htaccess
  - Copy [web-root]/example.gitignore from assets/scaffold/files/example.gitignore
  - Copy [web-root]/index.php from assets/scaffold/files/index.php
  - Copy [web-root]/INSTALL.txt from assets/scaffold/files/drupal.INSTALL.txt
  - Copy [web-root]/README.txt from assets/scaffold/files/drupal.README.txt
  - Copy [web-root]/robots.txt from assets/scaffold/files/robots.txt
  - Copy [web-root]/update.php from assets/scaffold/files/update.php
  - Copy [web-root]/web.config from assets/scaffold/files/web.config
  - Copy [web-root]/sites/README.txt from assets/scaffold/files/sites.README.txt
  - Copy [web-root]/sites/development.services.yml from assets/scaffold/files/development.services.yml
  - Copy [web-root]/sites/example.settings.local.php from assets/scaffold/files/example.settings.local.php
  - Copy [web-root]/sites/example.sites.php from assets/scaffold/files/example.sites.php
  - Copy [web-root]/sites/default/default.services.yml from assets/scaffold/files/default.services.yml
  - Copy [web-root]/sites/default/default.settings.php from assets/scaffold/files/default.settings.php
  - Copy [web-root]/modules/README.txt from assets/scaffold/files/modules.README.txt
  - Copy [web-root]/profiles/README.txt from assets/scaffold/files/profiles.README.txt
  - Copy [web-root]/themes/README.txt from assets/scaffold/files/themes.README.txt
> cd web && patch -p1 <../patches/htaccess.patch
patching file .htaccess
> cd web && patch -p1 <../patches/development.services.yml.patch
patching file sites/development.services.yml

<strong>$ drush en contact_storage</strong>
 [error]  An error occurred while notifying the creation of the id field storage definition: "!message" in Drupal\Core\Entity\Sql\SqlContentEntityStorage->wrapSchemaException() (line 1615 of C:\web\theme-one\web\core\lib
\Drupal\Core\Entity\Sql\SqlContentEntityStorage.php).
 [error]  An error occurred while notifying the creation of the created field storage definition: "!message" in Drupal\Core\Entity\Sql\SqlContentEntityStorage->wrapSchemaException() (line 1615 of C:\web\theme-one\web\core\lib\Drupal\Core\Entity\Sql\SqlContentEntityStorage.php).
 [error]  An error occurred while notifying the creation of the uid field storage definition: "!message" in Drupal\Core\Entity\Sql\SqlContentEntityStorage->wrapSchemaException() (line 1615 of C:\web\theme-one\web\core\li
b\Drupal\Core\Entity\Sql\SqlContentEntityStorage.php).
 [error]  An error occurred while notifying the creation of the ip_address field storage definition: "!message" in Drupal\Core\Entity\Sql\SqlContentEntityStorage->wrapSchemaException() (line 1615 of C:\web\theme-one\web\
core\lib\Drupal\Core\Entity\Sql\SqlContentEntityStorage.php).
>  [notice] Übersetzung für contact_storage überprüft.
>  [notice] Übersetzung für contact_storage heruntergeladen.
>  [notice] Übersetzung für contact_storage importiert.
tiert.
>  [notice] Translations imported: 70 added, 27 updated, 0 removed.
>  [notice] Message: Übersetzungsdatei wurde importiert. /70/ Übersetzungen wurden hinzugefügt,
> /27/ Übersetzungen wurden aktualisiert und /0/ Übersetzungen wurden
> entfernt.
>

>
 [success] Successfully enabled: contact_storage

Drupal version 8.8.5 on a local DEV-Environment.

mstef’s picture

Status: Postponed (maintainer needs more info) » Active
mstef’s picture

Tests are failing for 8.9.x: https://www.drupal.org/pift-ci-job/1533120

mstef’s picture

Not 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)

mstef’s picture

Status: Active » Needs review
StatusFileSize
new2.75 KB

Seems the base field hook is being invoked before the entity base table has been created. Patch adds a check before returning the additional fields.

godotislate’s picture

StatusFileSize
new1.75 KB

Can 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 to hook_preinstall().

perignon’s picture

Status: Needs review » Reviewed & tested by the community

The 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.

berdir’s picture

That 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?

jibran’s picture

Status: Reviewed & tested by the community » Needs review

NR for #10.

nikosnikos’s picture

Tried patch #7 and it works for me. Drupal 9.1.5. Contact Storage 8.x-1.1.

kaszarobert’s picture

Status: Needs review » Reviewed & tested by the community

Patch #8 fixes the errors during module install described in #3.

escuriola’s picture

Path #8 works for me too in a clean Drupal 9 with PHP 7.3

d70rr3s’s picture

Also #8 working on 9.2 and PHP 7.4. Thanks!

kleiton_rodrigues’s picture

Assigned: Unassigned » kleiton_rodrigues
kleiton_rodrigues’s picture

Assigned: kleiton_rodrigues » Unassigned
StatusFileSize
new31.25 KB

Patch #8 it works for me working on Drupal Version 8.9.9 and PHP 7.3.
RTBC +1

kleiton_rodrigues’s picture

Assigned: Unassigned » kleiton_rodrigues
kleiton_rodrigues’s picture

Assigned: kleiton_rodrigues » Unassigned
boobaa’s picture

I can confirm that the patch in #8 also works in drupal-9.2.7 and solves the problem described in #3.

larowlan’s picture

Status: Reviewed & tested by the community » Needs review

#10 asked for changes here

rosk0’s picture

Addressing #10, if I understood it correctly.

mxr576’s picture

I 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

mxr576’s picture

berdir’s picture

> 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.

andrew answer’s picture

StatusFileSize
new2.43 KB

I fixed this bug using the alternate way. I was created the table in DB with hook_schema().

sagesolutions’s picture

Status: Needs review » Reviewed & tested by the community

I tested patch #26 on a clean install Drupal 9.5.3 with PHP 8.1.

Before, I was getting the following errors

[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 1594 of /var/www/html/drupal/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 1594 of /var/www/html/drupal/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 1594 of /var/www/html/drupal/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 1594 of /var/www/html/drupal/web/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php).

After applying patch #26 The module installed properly with no errors.

aaronbauman’s picture

Looks like another duplicate issue, closed on this one.
#3330460: Fields cannot be created when installing

hyperlogos’s picture

Patch #26 works here

kleiton_rodrigues’s picture

Patch #26 RTBC +1

tonytheferg’s picture

+1 for the patch in #26 Couldn't install the module through importing config without the schema.

andres.torres’s picture

+1 for #26, Working on Drupal 10.2.6 fresh install.

inversed’s picture

#26 works for me using existing config sync yaml on a fresh install.

berdir’s picture

Status: Reviewed & tested by the community » Fixed

Rebased and merged.

  • Berdir committed 17e18625 on 8.x-1.x authored by godotislate
    Issue #3053497 by godotislate, RoSk0, mstef, kleiton_rodrigues, Berdir:...
berdir’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

kopeboy’s picture

In which release can we find this?

marvs5’s picture

I 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