Allow migration of custom link types #111
Answered
by
engram-design
pixelmachine
asked this question in
Q&A
-
I've just migrated from Typed Link and most of the fields are good but there are a few errors like:
|
Beta Was this translation helpful? Give feedback.
Answered by
engram-design
Jan 30, 2024
Replies: 1 comment 2 replies
-
All of the failures are custom link types and I see now that the migration only targets the built in types. Perhaps it would be good to have a way to pass additional classes to the migration? For example just passing the relevant class into the $typeMap works perfectly and imports custom links: MigrateTypedLinkField.php public array $typeMap = [
// ... (default link types) ...
// My custom link type
'book' => \modules\booklink\models\BookLinkType::class,
] |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
So yep, there's no handling for custom link types as you'd need to provide a source and destination class to convert them to. But you can of course use an event to register your own handling of these custom types. See docs
This will modify the
typeMap
property to translate what the old link type was to the new one. Yours would look something like: