-
Notifications
You must be signed in to change notification settings - Fork 65
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
Fix for issue with typed link field migration for craft 4 #261
Comments
Thanks this was driving me crazy. What is the exact issue here, and why does this fix it? Pre-migration: {"ariaLabel":null,"customQuery":null,"customText":"Gratisadviesgesprek","target":"","title":null,"type":"url","value":"#leadform"} Post-migration: {"ariaLabel":null,"customQuery":null,"customText":"Gratis adviesgesprek","target":"","title":null} EDIT: |
Is this also a solution for #250? 🙂 |
This solution works pretty well - ideally the maintainer will add the try/catch to the migration. But until then, here are some steps you can take to take to get this working across different environments.
|
I've encountered a migration error saying a duplicate entry has already been added. If anyone has a similar issue,. You can modify the plugin migration class and try out my solution: https://gist.github.com/pdaleramirez/681b1fffb082c7ceed8be02f5c7455e8 I modified the class, and it worked for me. |
I was able to use pdaleramirez's solution with one slight modification to complete the migration |
If you have any bugs with typed link field follow the next steps.
Go to your vendor. Go to the next path: sebastianlenz -> linkfield -> src -> migrations. Find the migration .php file. Search for the following line: "$payload = Json::decode($row[$columnName]);". The last part: place this piece of code in a try catch like this:
try {
$payload = Json::decode($row[$columnName]);
} catch(\Exception $e) {
var_dump($table);
var_dump($columnName);
var_dump($row);
var_dump($e->getMessage());
continue;
}
This should fix it.
The text was updated successfully, but these errors were encountered: