Hi,
After migrating (D6 to D8) I get this issue when I want to run cron with drush:
drush @vmdevd8ce cron
PHP Fatal error: Unsupported operand types in /var/www/drupal-8/core/lib/Drupal/Core/Utility/LinkGenerator.php on line 153
Drush command terminated abnormally due to an unrecoverable error. [error]
Error: Unsupported operand types in /var/www/drupal-8/core/lib/Drupal/Core/Utility/LinkGenerator.php, line 153
<div class="field field--name-field-lien-interne field--type-link field--label-hidden field__item">via the UI I get a WSOD.
I don't know what I can check or set to avoid this error.
Possibly related to my uncomplete block migration ?
Etat Total Imported Unprocessed
d6_block Idle 415 27 0 Thanks
Comments
Comment #2
aiphesComment #3
cilefen commentedThat is happening because $variables on line 153 is not an array so it cannot be added to an array with the '+' operator (as in
$foo = [] + ''produces this). If you put a breakpoint there, or even just var_dump $variables and exit, you may get an idea of the cause. Is the chunk of HTML in the issue summary actually part of the Drush output? What's the Drush version?(edited for clarity)
Comment #4
aiphesyes it's the Drush output, and is version is :
Do the incomplete block migration could be one cause ?
Comment #5
aiphesThis error happen at the same time.Perhaps related ?
EDIT: I can reproduce the error happening when I run
d6_term_node:1migration with drush.Rollback doesn't clear the error on Cron.Comment #6
cilefen commentedBecause according to #3000611: Could not load data, please refresh the page error you can reproduce this in the UI, it's probably not caused by Drush. Be aware you should be on Drush 9 with Drupal 8.4+.
Let's see what you find by debugging (#3) and you should execute Drush in verbose mode.
Comment #7
aiphesActually the Coffee bug doesn't happen so it's not really related.
This is the cron debug mode: https://gist.github.com/webmasterpf/3ec7da7b7a54ecb9c57eaa79d79faf9a
I need Drush 8 because I manage D6 and D8 websites until the end of migrations (8 websites to go).
Comment #8
aiphesContent of 2 differents content type cause this error and break the CRON.
No common fields, each use linkfield, reference entity field (taxonomy),image field(multi-value).
How can I do debug as #3 suggest ?
Comment #9
aiphesAfter looking into data in db and compare between D6 and D8, I see empty db fields for these linkfield.
I have a linkfield with no migration issue, and source db field isn't empty.
On my 2 content types with errors, there are db field:
For example, the field_lien_externe_url db field take normally
url'sORNULLif no data, but it happens db field empty.I think this could be the origin of the error.
So how can I replace empty data by
NULLmention in db field ? search and replace in db ? To test my theory.Comment #10
aiphesI compared records in
content_field_lien_externeD6 table andnode__field_lien_externeD8 table .It appears that all records with NULL or empty label/field aren't migrated (ignored).
So the D6 table with 312 records go to 23 records after migration into D8 db. This is why the linkgenerator error happen I guess.
Can I force migration of all records with a custom migration module ? If yes, how to map them ? Actually I do this whithout changes on this error:
Comment #11
aiphesReviewing records from working content migration, it appear that empty and NULL label are skipped as a normal way.
So my issue, come from a corrupted data or something like in a record...will not be easy to find.
EDIT: finally, records from the
content_field_lien_externetable (D6) (199 non empty records over 312 in all) are dispatched innode_revision__field_lien_externetable (199 records) andnode__field_lien_externetable (D8)(23 records). Are these 23 twice records cause error ?Comment #12
aiphesI investigate more and more and I get the culprit node (one of) among all nodes for a content type that break CRON.
In DB records, I see a difference,perhaps the cause, but I don't know what about is it.This is extraction records from D8 DB:
Difference is in the field_lien_interne_options field table.
page_fiche_formation;0;219;247;fr;0;internal:/node/21;Coût de la scolarité;"a:1:{s:10:""attributes"";s:6:""a:0:{}"";}"
Is someone know what kind of option is it ? Could it be the error origin ?
Comment #13
aiphesI test on another content type and I notice that records that contains
"a:1:{s:10:""attributes"";s:32:""a:1:{s:6:""target"";s:6:""_blank"";}"";}"in thefield_lien_internet_rp_optionsbreak CRON with linkgenerator error and content give a WSOD (node__field_lien_internet_rpdb table)I edit this content and re-save it, and error disappear + CRON work again.
In db record, the
field_lien_internet_rp_optionscontain nowa:0:{}and all is as designed. But I don't know whats:32:is related (option of CCK linkfield for sure but which one ?) ans I don't know how to do a MySQL query to replace it in the db after migration because this data is in a blob.Comment #14
aiphesNew migration on another server and errors are back : but I found the way to modify blob content like this:
update node__field_lien_interne set field_lien_interne_options=replace(field_lien_interne_options, 'a:0:{}', 'a:1:{s:10:"attributes";a:0:{}}') where field_lien_interne_options like '%a:0:{}%';I just need to put the replaced string as absolute, otherwise all records are affected in the table because of the replaced string is too much generic.
Comment #17
quietone commented@aiphes, Did you resolve this problem? If so, what did you do?
I've been working on the related migration issue and there is a working patch there now. I do appreciate that you are likely to have found a solution in the meantime.
Comment #18
aiphesHello
since I do migration on D8.9 this issue disappeared.
The only thing noticiable, is the none mention on linkfield after migration.
Comment #22
quietone commented@aiphes, thanks for reporting back! I am glad to found a solution.
According to #18, this has been resolved by migrating to Drupal 8.9. I am closing this as outdated.