verbb / hyper

A Craft CMS plugin for managing links, focusing on user experience.
Other
22 stars 11 forks source link

Migrating from Linkit does not create project-config changes #73

Open shoored opened 1 year ago

shoored commented 1 year ago

Describe the bug

We are updating a Craft 3 project to Craft 4 and are switching from Linkit to Hyper. After the v4 upgrade, we installed Hyper and ran the CLI migrate field command.

The output was successful and all Linkit fields where migrated. However, I don't see any changes in the project folder regarding these fields. Most Linkit / Hyper fields are within Super Table fields or within Super Table fields in Matrix field blocks.

I saved some fields manually in Craft and that did create file changes in the project folder.

After running the content migration CLI command I checked some fields in Craft to see if the content was still there. Strangely enough the Hyper field UI was missing, it was just empty. This happens with a few Super Table fields, but not all.

I then resaved these fields from the Settings panel, reloaded the entry and boom, the field + the migrated content appeared.

I'm not sure if these are seperate issues. Please let me know if you need more information.

We are planning to do the live v4 upgrade this sunday but this is currently a show stopper. It would be great if you could let me know if you have time to look into this this week or not? Just so I can set expectations with the client. Cheers!

Steps to reproduce

  1. Have a site with the Linkit plugin
  2. Install Hyper plugin
  3. Run craft hyper/migrate/linkit-field
  4. No project config changes
  5. Run craft hyper/migrate/linkit-content
  6. Missing Hyper field UI in Craft
  7. Resave the corresponding field in Settings panel
  8. Field + content appears

Craft CMS version

4.4.14

Plugin version

1.1.8

Multi-site?

Yes

Additional context

No response

engram-design commented 1 year ago

So I can definitely confirm there are project config changes when I run this. Maybe running ./craft project-config/rebuild before anything, just to ensure files are up to date? I can also confirm that the migration will handle Matrix and Super Table field combos.

shoored commented 1 year ago

Yeah something felt off so I just tried the upgrade process again.

Am I missing something? I don't get any errors when migration Linkit.

engram-design commented 1 year ago

So the only change in your yaml files is changedFieldIndicator (for the Super Table field)? It doesn’t show the link field type changed from LinkIt to Hyper at the very least?

Struggling to reproduce that, and I’m not sure how the database could be updated and the yaml files not…

shoored commented 1 year ago

No, it shows more changes than that. I'm sorry, just thought this was perhaps an indicator that something did not really change prior. I've now done the whole process multiple times, I cannot get it to actually change the yaml files. We have to manually save them.

Btw, we're on Postgress 11, but I doubt that changes things. It's about 21 fields, I think we'll just resave them manually.

Wish I had better things to report, its confusing me so it must be hard to process on your end 😅

engram-design commented 1 year ago

Thanks for the updates, I’ll continue to see if I can replicate things on my end. But yes unfortunately for now, a manual re-save of fields may be in order to kick things into gear. Or, rebuilding the PC after running the console command that seemingly applies, just only to the database.

shoored commented 1 year ago

Hey @engram-design, we did the whole process several times. It's hard to pinpoint what the culprit is. We updated Linkit a few weeks a go and the plugin has a new home and new namespace. I found several references to the old "fruitstudios/linkit" instead of "presseddigital/linkit" in both database and yaml files.

We did clean those up before we ran Hyper's migrations and that did seem to fix some issues, like missing field instances. The YAML files did not change, only after running PC rebuild.

Sorry that I can't provide more indepth details. We finished the Craft 4 upgrade this weekend. Perhaps this was only occuring in our setup for whatever reason. We're good on our end for now 👍

engram-design commented 1 year ago

Hmm, good call on the fruitstudios/linkit references, I might look into that, although it’s likely they’ll need to be migrated correctly within Linkit first.

Regardless, glad your migration ended up okay.

Ticolyle commented 1 month ago

Hi @engram-design My team has seen the same situation crop up with LinkIt field migration.

Project config changes happened for stand alone LinkIt fields in config/project/fields, but were not generated for config/project/matrixBlockTypes or config/project/superTableBlockTypes.

When I manually triggered rebuild I was then able to see the changes to those matrix/supertable fields.

Of note, I am only able to find references to the presseddigital version, none to fruitstudios in our YAML files.

PHP: 8.2.19
SQL: MariaDB 10.4.33
Craft: 4.7.4
Hyper: 1.2.0
Linkit: 4.0.4.1