Problem/Motivation

When I try to install the Geolocation Demo module the following error occurs:

InvalidArgumentException: Field field_geolocation_demo_term_icon is unknown. in Drupal\Core\Entity\ContentEntityBase->getTranslatedField() (Zeile 617 in /var/www/ud18_88/html/terrafera/core/lib/Drupal/Core/Entity/ContentEntityBase.php).
#0 /var/www/ud18_88/html/terrafera/core/lib/Drupal/Core/Entity/ContentEntityBase.php(597): Drupal\Core\Entity\ContentEntityBase->getTranslatedField()
#1 /var/www/ud18_88/html/terrafera/core/lib/Drupal/Core/Entity/ContentEntityBase.php(658): Drupal\Core\Entity\ContentEntityBase->get()
#2 /var/www/ud18_88/html/terrafera/modules/contrib/geolocation/modules/geolocation_demo/geolocation_demo.install(45): Drupal\Core\Entity\ContentEntityBase->set()
#3 /var/www/ud18_88/html/terrafera/core/lib/Drupal/Core/Extension/ModuleInstaller.php(829): geolocation_demo_install()
...

Afterwards the module is marked as installed but I can't find any demo content.

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

janc48 created an issue. See original summary.

dkmishra made their first commit to this issue’s fork.

dkmishra’s picture

StatusFileSize
new4.7 KB

Attached patch moves the configuration required by geolocation_demo_install() from config/optional to config/install.

Drupal runs hook_install() before optional configuration is installed. As a result, the install hook tries to populate fields that do not yet exist. Moving the required content type, vocabulary, field storage, and field configuration ensures they are available before the install hook creates demo terms and nodes. The patch applies cleanly to 4.0.0-beta2.

janc48’s picture

Installing the demo module now creates some data, it returns with 500 server error though leaving no watchdog record behind.
The demo data is however without pages and views and doesn't help me much.
Thank you for your fix anyway @dkmishra!

christianadamski’s picture

Status: Active » Postponed (maintainer needs more info)

Please try current dev and see if it works for you now please.

janc48’s picture

There is no error when installing with dev.

christianadamski’s picture

Status: Postponed (maintainer needs more info) » Fixed

Stable release should also work fine now.

Thanks!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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