Problem/Motivation
I'm attempting to use the smart_date:migrate drush script as described in the "Migrating Data From Core Date Fields" documentation and encountering an error:
$ drush smart_date:migrate event_program field_when field_event_date
Starting date migration.In EntityTypeManager.php line 143:
The "" entity type does not exist.
Steps to reproduce
In the above example, "event_program" is the content type, "field_when" is the destination Smart Date field, and "field_event_date" is where the data will be drawn from.
I'm using Drupal 9.3.4, Drush 10.6.2, and Smart Date 3.5.0.
Previously this worked with earlier versions of Drupal 9, Drush, and Smart Date, but having upgraded all of them since, I'm at a loss to know what is causing the error now.
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | smart_date-drush_broken-3262983-6.patch | 972 bytes | mandclu |
Comments
Comment #2
sclsweb commentedComment #3
sclsweb commentedAha. It works as expected when --entity=node is specified in the drush command, like so:
Smart Date 3.5.0 declares a default value for 'entity' in SmartDateDrushCommands.php, differently than in prior versions:
The check on $options seems to be failing here(?).
Smart Date 3.4.3 has:
public function migrate($bundle, $dest, $source_start, $source_end = NULL, $source_all_day = NULL, $options = ['clear' => FALSE, 'entity' => 'node', 'default_duration' => 0, 'langcode' => NULL]) {Comment #4
sclsweb commentedAfter updating to Drupal core 9.3.5, the workaround of specifying the entity value in the drush command no longer works.
Gives the error, 'The "--entity" option does not accept a value.'
Rolling back to Smart_date 3.4.3, the drush command still works.
Comment #5
sclsweb commentedComment #6
mandclu commentedThe change that seems to have created so many problems with the drush command was originally to address some code standards issues, but breaking the command entirely is a poor bargain.
This patch reverts that change, which hopefully will resolve the cited problem.
Comment #8
mandclu commentedThis change was actually merged in as part of #3264802: Import Drush command doesn't work with date-only values, or all day timezones, so marking this as fixed. Feel free to re-open if additional work is needed.
Comment #9
mandclu commented