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

The migrate script only converts resources #134

Open
SnowCreative opened this issue Jun 14, 2024 · 4 comments
Open

The migrate script only converts resources #134

SnowCreative opened this issue Jun 14, 2024 · 4 comments

Comments

@SnowCreative
Copy link
Contributor

SnowCreative commented Jun 14, 2024

I ran migrate.php after updating a site. All the resource data was converted to the new format, but no data for chunks, templates, snippets, TVs, or plugins was converted.

Additionally, the error log is filled with errors like this:
PHP warning: Undefined array key "pagecolumns"
So the names of TVs show up as undefined array keys. I assume this is when it is converting resources, not other objects. No other errors get displayed.

MODX 3.0.4, VersionX 3.1.0

@muzzwood
Copy link
Contributor

Hmm that's odd. So there are no errors shown in the command line when you run the script?

Also. what line number are those warnings coming from?

@SnowCreative
Copy link
Contributor Author

SnowCreative commented Jun 14, 2024

Line 178.

But, I just deleted all the converted data and reinstalled the plugin and reran the migration script. All the other objects got converted this time.

I've noticed with several different plugins that I have to install them twice in MODX 3. The installation mostly goes fine, but there is an error message saying that a class name is in use. On the second installation, that message goes away. For VersionX this is the error:
PHP warning: Cannot declare class modPlugin, because the name is already in use.

So maybe the problem was an incomplete installation? I still get the undefined array key errors, though.

@muzzwood
Copy link
Contributor

muzzwood commented Jun 14, 2024

OK so line 178 probably needs to be changed to something like:

$beforeValue = !empty($prevItems[$key]) ? normalizeValue($prevItems[$key]) : '';

in order to stop that warning.


Is this a migration that's going from MODX 2.x to 3.x in addition to VersionX 2.x to 3.x?
If so, it's possible that's throwing something unexpected into the mix.

@SnowCreative
Copy link
Contributor Author

Is this a migration that's going from MODX 2.x to 3.x in addition to VersionX 2.x to 3.x?

The site was converted to 2.x to 3.x a while ago.

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