Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I tried to convert my contrib module, autoarch, and the conversion failed.
The output was:
Invalid argument supplied for foreach() EntityOperationDeriver.php:42 [warning]
PHP Fatal error: Unsupported operand types in ****/modules/drupalmoduleupgrader/src/Plugin/DMU/Rewriter/GenericDeriver.php on line 50
Drush command terminated abnormally due to an unrecoverable error. [error]
Error: Unsupported operand types in ****/modules/drupalmoduleupgrader/src/Plugin/DMU/Rewriter/GenericDeriver.php, line 50
The upgrade-info, generated by the module could be seen here:
http://drupal8-dev.drupler.hu/modules/autoarch/upgrade-info.html
Comment | File | Size | Author |
---|---|---|---|
#24 | 2607164-24.patch | 4 KB | andypost |
Comments
Comment #2
yukare CreditAttribution: yukare commentedI have the same error here.
Comment #3
jonasdk CreditAttribution: jonasdk as a volunteer commentedSame problem here on Drupal 8.0.1 with both the dev from 3th of December and 1.2.
Comment #4
Lennard CreditAttribution: Lennard commentedI have still exactly the same error and have not know what i can do !!!
And i Tested with:
- Newest Drupal (8.0.1)
- Drush 8.0.0 (comes with DevDesktop)
- Normal Composer Install and Updated Composer Version
- Drupal standard and minimal profile
it's really confusing
Comment #5
julien CreditAttribution: julien commenteda rewrite definition is missing from drupalmoduleupgrade.rewriters.yml for the langcode data_type, so instead of having a variable called definition who should be an array, the variable is a string with the langcode eg. DE, and it cannot merge a string and a array.
To fix this we need to add definitions for the langcode in drupalmoduleupgrade.rewrites.yml
Comment #6
julien CreditAttribution: julien commentedpatch for language data_type.
Comment #7
Lennard CreditAttribution: Lennard commented@julien thanks but its not help for run drupalmoduleupgrader without the errors :(
Comment #8
julien CreditAttribution: julien commented@Lennard. Did you uninstall drupalmoduleupgrader and reinstalled it to rebuild the config?
Comment #9
Lennard CreditAttribution: Lennard commented@ Julien now i tried with uninstall and new install...
This Error gone:
And this stay still:
Invalid argument supplied for foreach() EntityOperationDeriver.php:42 [warning]
Comment #10
julien CreditAttribution: julien commentedyes this php warning is coming from something else that i didn't looked for yet.
Comment #11
julien CreditAttribution: julien as a volunteer commentedComment #12
Lennard CreditAttribution: Lennard commentedBig Thanks for you Julien. Now i can used the module for menu routing and the first steps of porting.
For all other things of Changes in Drupal 8 must be programming by own work.
Therefore, one can not recommend it for beginners modules !!
Comment #13
julien CreditAttribution: julien as a volunteer commentedComment #16
julien CreditAttribution: julien as a volunteer commentedComment #17
Gábor HojtsyHow is a $langcode an object? It was supposed to be a language. I mean if the mapping would be from $language to this object, that sounds like would fit the naming patterns used. Not sure how that would fix your bug?
Comment #18
julien CreditAttribution: julien as a volunteer commented@Gábor Hojtsy, $langcode is maybe the wrong variable coming to:
as soon as you don't have en default uk language install.
it seems that static mapping needs to be done in config/install/drupalmoduleupgrader.rewriters.yml for now, default are core node, comment, taxonomy. I think each time a new core module is set during install, this file needs an update.
In my case the $langcode was coming up and was not an array. So it was concatenating an array with a string. To fix $langcode, the name is maybe wrong, but the object is now build from drupalmoduleupgrader.rewriters.yml with the right naming patterns after this.
Comment #19
Gábor HojtsyAll right, but drupalmoduleupgrader.rewriters.yml is a mapping for variable names to their Drupal 8 counterparts, right. In Drupal 7 $langcode would be for example 'fr'. How would that have the methods or properties you listed? $language would maybe if used properly :)
Comment #20
julien CreditAttribution: julien as a volunteer commentedyes i agree but langcode cames up here. I don't know yet, if it is the module or the core returning this variable. I did put this issue on the left for sometime now, i should get back into it to sort this variable issue out.
Comment #21
Gábor HojtsyRight, $langcode is a string, $language would have $language->getName(), etc. as per the mapping, so I don't think the mapping is correct or the code you dealt with uses the $langcode variable for a language object, which is not good in the first place. Not surprised if DMU cannot deal with that well :)
Comment #22
julien CreditAttribution: julien as a volunteer commentedyes but where should it return $language instead of $langcode, i'm not sure if it's inside this module but more of the core itself.
Comment #23
Gábor HojtsyIt would be good to see the use case honestly.
Comment #24
andypostlooks the issue because no config schema provided
here's a quickfix to make module work
Comment #26
geek-merlinYes fixes the issue for me.
Comment #27
jcnventura CreditAttribution: jcnventura at Wunder commentedThe patch above applies to drupalmoduleupgrader 8.x-1.2, and not to the dev version. Looking at the code that was committed in #2635944: InvalidArgumentException' with message '$string (""), and the above patches, it seems that the proper fix to this issue has already been committed in that issue.
Comment #28
jcnventura CreditAttribution: jcnventura at Wunder commentedComment #29
julien CreditAttribution: julien as a volunteer commented