TypeError: Argument 1 passed to Drupal\Core\Entity\Entity::create() must be of the type array, null given, called in [error]
/home/public_html_8/modules/domain/domain/domain.module on line 145 in Drupal\Core\Entity\Entity::create() (line 513 of
/home/public_html_8/core/lib/Drupal/Core/Entity/Entity.php) #0 /home/public_html_8/modules/domain/domain/domain.module(145):
Drupal\Core\Entity\Entity::create(NULL)
#1 /home/public_html_8/modules/domain/domain/domain.install(24): domain_confirm_fields('user', 'user')
#2 /root/.composer/vendor/drush/drush/commands/core/drupal/update.inc(58): domain_update_8001(Array)
#3 /root/.composer/vendor/drush/drush/commands/core/drupal/batch.inc(150): drush_update_do_one('domain', 8001, Array, Object(DrushBatchContext))
#4 /root/.composer/vendor/drush/drush/commands/core/drupal/batch.inc(102): _drush_batch_worker()
#5 /root/.composer/vendor/drush/drush/includes/batch.inc(90): _drush_batch_command('336')
#6 /root/.composer/vendor/drush/drush/commands/core/drupal/update.inc(170): drush_batch_command('336')
#7 /root/.composer/vendor/drush/drush/commands/core/core.drush.inc(1192): _update_batch_command('336')
#8 /root/.composer/vendor/drush/drush/includes/command.inc(364): drush_core_updatedb_batch_process('336', '336')
#9 /root/.composer/vendor/drush/drush/includes/command.inc(215): _drush_invoke_hooks(Array, Array)
#10 /root/.composer/vendor/drush/drush/includes/command.inc(183): drush_command('336', '336')
#11 /root/.composer/vendor/drush/drush/lib/Drush/Boot/BaseBoot.php(65): drush_dispatch(Array)
#12 /root/.composer/vendor/drush/drush/includes/preflight.inc(64): Drush\Boot\BaseBoot->bootstrap_and_dispatch()
#13 /root/.composer/vendor/drush/drush/drush.php(12): drush_main()
#14 {main}.
TypeError: Argument 1 passed to Drupal\Core\Entity\Entity::create() must be of the type array, null given, called in /home/public_html_8/modules/domain/domain/domain.module on line 145 in Drupal\Core\Entity\Entity::create() (line 513 of /home/public_html_8/core/lib/Drupal/Core/Entity/Entity.php).
Drush command terminated abnormally due to an unrecoverable error.

Comments

RobertoGuzman created an issue. See original summary.

lba_emanuel’s picture

Issue summary: View changes

Hi,

You need to add manually the Domain Admin field.

See https://www.drupal.org/project/domain/releases/8.x-1.0-alpha7

For site administrators

If you have previously installed the module, you will have to do a few things.

  • Fix domain_id numeric values.
    • Enable Domain Alpha
    • Run the database upgrade
    • If using config management, re-export the domain records and check in to version control.
  • Install the Domain Admin field
    • No update is provided for this field.
    • Add manually, using the field ui or loading from the two config files field.storage.user.field_domain_admin.yml and field.field.user.user.field_domain_admin.yml
    • If creating the field manually, if must have the machine name of field_domain_admin
    • Set the form display to use checkboxes.
  • Check permissions
    • Reassign permissions as desired, if necessary. For admins with Administer domains, no changes should be required.
    • In addition to the changes to Domain permissions noted above, Domain Alias now supports assigning editors to create/edit/delete aliases for assigned domains (see below).
dremy’s picture

I got this error as well. I followed the above instructions:

Fix domain_id numeric values.

  • Enable Domain Alpha
  • Run the database upgrade

But when running drush updatedb I still got the update error above.

dremy’s picture

Also getting this:

Notice: Undefined index: field_domain_admin in Drupal\domain\DomainElementManager->setFormOptions() (line 44 of /modules/domain/domain/src/DomainElementManager.php).

dremy’s picture

Alright I solved this by:
1. Fix domain_id numeric values
-- Enabling Domain Alpha
-- Run the database upgrade: This is not drush updatedb OR update.php. I needed to use drush entup to fix Mismatching Entity field definitions. Then I ran update script to perform 8001.

Then performing from above:
2. Install the Domain Admin field
3. Check permissions

agentrickard’s picture

There is also a bug that was recently fixed, which you can find here -- https://github.com/agentrickard/domain/pull/306/files

@dremy I'm interested in the drush entup solution. I didn't run into that in testing.

agentrickard’s picture

And I just pushed 8.x-1.x-dev over from GitHub, so the original error should be fixed in the dev version today.

dremy’s picture

Thanks. Ya, drush entity update essentially cleans up rogue field definitions.

agentrickard’s picture

Status: Active » Fixed

Thanks. I updated the release notes to point here as well.

https://www.drupal.org/project/domain/releases/8.x-1.0-alpha7

Status: Fixed » Closed (fixed)

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

agentrickard’s picture