Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP Fatal error on migration script #128

Open
krismas opened this issue Mar 18, 2024 · 2 comments
Open

PHP Fatal error on migration script #128

krismas opened this issue Mar 18, 2024 · 2 comments

Comments

@krismas
Copy link

krismas commented Mar 18, 2024

We encountered the following error when running the migration code:

PHP Fatal error:  Uncaught TypeError: Return value of mergeTVs() must be of the type array, null returned in /home/ackwa/sites/v3/core/components/versionx/migrate.php:226
Stack trace:
#0 /home/ackwa/sites/v3/core/components/versionx/migrate.php(83): mergeTVs()
#1 /home/ackwa/sites/v3/core/components/versionx/migrate.php(36): createDelta()
#2 {main}
  thrown in /home/ackwa/sites/v3/core/components/versionx/migrate.php on line 226

After a quick analysis, it seems that the problem is caused by a deserialization error when calling $object->get('fields') which then returns null.

Environment :

  • MODX : 2.8.6
  • VersionX : 3.0.1-pl
  • PHP : 7.4.33
@muzzwood
Copy link
Contributor

Do you know if the fields value for that object is empty?
Does it work if you change that line to: $object->get('fields') ?? [],?

@krismas
Copy link
Author

krismas commented Mar 26, 2024

The value of the field was not empty, but the serialization was in error (ie unserialize(): Error at offset...).

Does it work if you change that line to: $object->get('fields') ?? [],?

I made a change similar to the one you suggest in order to solve the problem until a permanent fix is found.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants