- Issue created by @Toki
- Status changed to Needs review
about 1 year ago 12:41pm 20 September 2023 - 🇳🇱Netherlands johnv
Please try the attached patch.
There is a change record MigrateIdMapInterface::lookupDestinationId() deprecated → - 🇫🇷France Toki Caen, Normandy
Thanks for the quick answer.
I can't find that patch this morning.
I have just tried it but unfortunately a new error appears :[error] Error: Class "WorkflowState" not found in workflow_migrate_upgrade_d7_workflow_transition_prepare_row() (line 39 of /home/my_d10_website/public_html/my_d10_website_root/web/modules/contrib/workflow/workflow.migrate.inc) #0 [internal function]: workflow_migrate_upgrade_d7_workflow_transition_prepare_row() #1 /home/my_d10_website/public_html/my_d10_website_root/web/core/lib/Drupal/Core/Extension/ModuleHandler.php(409): call_user_func_array() (...) #28 {main}. Error: Class "WorkflowState" not found in /home/my_d10_website/public_html/my_d10_website_root/web/modules/contrib/workflow/workflow.migrate.inc on line 39 #0 [internal function]: workflow_migrate_upgrade_d7_workflow_transition_prepare_row() #1 /home/my_d10_website/public_html/my_d10_website_root/web/core/lib/Drupal/Core/Extension/ModuleHandler.php(409): call_user_func_array() (...) #28 {main} Error: Class "WorkflowState" not found in workflow_migrate_upgrade_d7_workflow_transition_prepare_row() (line 39 of /home/my_d10_website/public_html/my_d10_website_root/web/modules/contrib/workflow/workflow.migrate.inc). [warning] Drush command terminated abnormally.
- 🇫🇷France Toki Caen, Normandy
Here si the message in Migrate Tools UI for each new fail for upgrade_d7_workflow_config_transition :
upgrade_d7_workflow_config_transition:roles:migration_lookup: flatten: Input should be an array or an object, instead it was of type 'NULL'
- 🇳🇱Netherlands johnv
Regarding #4. I hope you found the attached a patch in #3. Perhaps you must apply it manually.
- 🇳🇱Netherlands johnv
Regarding your error in #4.
I find it strage that you report line 39.
my actual workflow.migrate.inc is like this:08 use Drupal\workflow\Entity\WorkflowState; ... 39 // Set source and target lookups. 40 $sid2wid[$row->getSourceProperty('old_sid')] = 41 $sid2wid[$sid] = WorkflowState::load($new_sid)->getWorkflowId(); ...
So, I would expect an error in line 41.
as a testing alternative, please replace WorkflowState in line 41 with "Drupal\workflow\Entity\WorkflowState" or "\Drupal\workflow\Entity\WorkflowState" (preceding backward slash.)I guess, i cannot help with the related issue?
- 🇫🇷France Toki Caen, Normandy
Thanks for your time.
Yesterday, I have applied the patch in #3 manually and the original error message has disappeared, leading to the second one in #4.
I have just checked "my" workflow.migrate.inc file and surprisingly there is no use statement line 8 (that explains the line 39/line 41 difference).
Let me go back to you after a new test.I added the related issue because there was some similarity with this issue but if it does not help I can delete it from here.
- 🇫🇷France Toki Caen, Normandy
Sorry but still an issue.
upgrade_d7_workflow : no problem, my workflow named "manuscrit" is imported from D7 to D10.
upgrade_d7_workflow_state : 12 states are imported but from here if I try to open /admin/config/workflow/workflow/manuscrit/transition_roles I get a wsod with this error in the log :
Drupal\Core\Entity\EntityStorageException: 'workflow_config_transition' entity with ID 'manuscrit_creation' already exists. in Drupal\Core\Entity\EntityStorageBase->doPreSave() (line 519 of /home/my_d10_website/public_html/my_d10_website_root/web/core/lib/Drupal/Core/Entity/EntityStorageBase.php).
then, I have tried upgrade_d7_workflow_config_transition : 44 failed with this error for each in Migrate Tools UI :
upgrade_d7_workflow_config_transition:roles:migration_lookup: flatten: Input should be an array or an object, instead it was of type 'NULL'
finally, tried upgrade_d7_workflow_transition (with both patch #3 and modification #8) :
[warning] array_flip(): Can only flip string and integer values, entry skipped EntityStorageBase.php:278 [warning] Array to string conversion EntityStorageBase.php:142 [error] TypeError: Illegal offset type in Drupal\Core\Entity\EntityStorageBase->load() (line 263 of /home/my_d10_website/public_html/my_d10_website_root/web/core/lib/Drupal/Core/Entity/EntityStorageBase.php) #0 /home/my_d10_website/public_html/my_d10_website_root/web/core/lib/Drupal/Core/Entity/EntityBase.php(488): Drupal\Core\Entity\EntityStorageBase->load() (...) TypeError: Illegal offset type in /home/my_d10_website/public_html/my_d10_website_root/web/core/lib/Drupal/Core/Entity/EntityStorageBase.php on line 263 #0 /home/my_d10_website/public_html/my_d10_website_root/web/core/lib/Drupal/Core/Entity/EntityBase.php(488): Drupal\Core\Entity\EntityStorageBase->load() (...) TypeError: Illegal offset type in Drupal\Core\Entity\EntityStorageBase->load() (line 263 of /home/my_d10_website/public_html/my_d10_website_root/web/core/lib/Drupal/Core/Entity/EntityStorageBase.php). [warning] Drush command terminated abnormally.
- 🇫🇷France Toki Caen, Normandy
Just one more precision, users and user roles have been imported first, of course.
Concerning the error linked to
upgrade_d7_workflow_config_transition
(withNULL
values apparently), I have also checked theworkflow_transitions
on source site (d7) and I have data, notably in roles column (see capture). - 🇫🇷France Toki Caen, Normandy
Any idea?
Could it be the new states machine name patterns?
If I am correct now it is workflow_name_state_name so my first default state went from creation to manuscrit_creation.
And if I try to enter manually my D7 states, machine names are automatically created and untouchable. - 🇫🇷France Toki Caen, Normandy
If it's OK with you johnv, I change the status to Active.
- Status changed to Active
about 1 year ago 8:26am 25 September 2023 - 🇳🇱Netherlands johnv
I am sorry I cannot help you further.
I can point you to the plugins, like: workflow\src\Plugin\migrate\source\d7\WorkflowConfigTransition.php
(here, the tid is defined as an integer)and to the definitions, like: \workflow\migrations\d7_workflow_config_transition.yml
When, in your database, you check the 'config' table, do you correctly see all states and transitions? When building a workflow via UI, the transitions are created automatically.
Also, I remember, that a setting is introduced to yes/no create the required 'creation' state. - 🇫🇷France Toki Caen, Normandy
Thanks for your time anyway.
Indeed, I have tried to understand where something goes wrong in both
WorkflowConfigTransition.php
ord7_workflow_config_transition.yml
.
I will continue to look for the error in my case.After
upgrade_d7_workflow
,upgrade_d7_workflow_state
and failedupgrade_d7_workflow_config_transition
, workflow and its states are in config table but only one transition (xxxx_creation) appears.In D10 UI, I can't see any settings on creation state when adding new workflow? Only label, permissions, form settings and watchdog.
I am pretty confident someone has already managed to migrate workflow configuration from Drupal 7 to Drupal 10, so please if you are this person, feel free to share your experience :)
- 🇫🇷France Toki Caen, Normandy
Digging further into the files triggered by
upgrade_d7_workflow_config_transition
, I traced back to thed7_user_role.yml
file where the permissions associated with each role are retrieved in therole_permission
(D7) table.
However, from the first line of this table, the permission is linked to a module (biblio) which is no longer available on Drupal 10 and which has been replaced by another with a different machine name (bibcite).
It is therefore very likely that the process will fail because of this.
I traced the problem to this thread → (see related issue).
Roles in D10 site are already set and the permissions will probably evolve and be managed manually.
Would it be possible to simply modify thed7_workflow_config_transition.yml
file so as not to triggerd7_user_role
and thus unlock the situation? - 🇳🇱Netherlands johnv
First, another thought.
Workflow::createState() has a $save=Y/N parameter, which tells the system to yes/no save a state. I guess in the migrate situation, NO status must be created, since it is imported later on. - 🇳🇱Netherlands johnv
Please try to modify the yml files.
Please check the other 'migrate' issues. There might be a hint. - 🇫🇷France Toki Caen, Normandy
While visiting the Drupal Slack migration group, I came across another user who recently was also unable to recover his Workflow between D7 and D10. After a week of research and testing, I finally gave up on the idea of recovering my Workflow configuration. So I finally used the excellent Migrate Skip Fields → module and deleted my Workflow field on the target site. The migration process for the nodes associated with the workflow was unblocked and I was able to recover them. Now I'm going to edit these nodes with a new fresh workflow and some SQL or Views Bulk Operations queries.
- 🇮🇷Iran nick2006
The website encountered an unexpected error. Try again later.
Drupal\migrate\Audit\AuditException: Cannot audit migration d7_workflow: Destination does not implement Drupal\migrate\Audit\HighestIdInterface in Drupal\migrate\Audit\IdAuditor->audit() (line 31 of core\modules\migrate\src\Audit\IdAuditor.php).
Any idea?