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

Linkit field not respecting fieldtype #615

Closed
WHITE-developer opened this issue Oct 7, 2019 · 3 comments
Closed

Linkit field not respecting fieldtype #615

WHITE-developer opened this issue Oct 7, 2019 · 3 comments

Comments

@WHITE-developer
Copy link

Description

Trying to import an csv to create entries with several linkit fields. I can specify a Type, Custom URL and Custom Text, but the Type always gets fruitstudios\linkit\models\Url instead of fruitstudios\linkit\models\Phone I specify as the default.

Steps to reproduce

  1. Entry with Linkit field which only has the "Phone" option enabled and "Allow custom text"
  2. Csv to create a new entry
  3. Map the linkit field to for example:
  • Type - Use default value - fruitstudios\linkit\models\Phone
  • Custom URL - <Phone full> 0031 6 12345678
  • Custom Text - <Phone> 06 12345678
  1. Save and do the import
  2. Field will be mapped but overridden with "Url" type like "phone":{"type":"fruitstudios\\linkit\\models\\Url","value":"0031 6 12345678","customText":"06 12345678"}

Additional info

  • Plugin version: 4.1.2
  • Craft version: 3.3.4.1
@elivz
Copy link

elivz commented Oct 30, 2019

I am running into this too. Looks like the URL "type" is hardcoded in the field importer. So whatever type you set in your source data will always be overwritten. Can be fixed by changing line 45 of src/fields/Linkit.php to:

if ($preppedData && empty($preppedData['type'])) {

@olivierbon
Copy link
Member

Fixed in #622

@brandonkelly
Copy link
Member

Feed Me 4.2.0 is out now with the fixed Linkit support.

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

4 participants