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

Entry Field - Sub Field data matching shows wrong fields and incorrect naming #1572

Closed
svondervoort opened this issue Jan 16, 2025 · 10 comments
Assignees
Labels

Comments

@svondervoort
Copy link

Description

When mapping on Entry fields that have separate Entry Types with different fields you still see the same fields in the dropdown.
Also these fields have the titles as named in the Fields config and not the titles from the specified Entry Type.

This prevents us from importing certain data on a custom ID (Number field) and we are forced to resort to the default Title field until this is resolved.

Image
Image

Additional info

  • Craft version: 5.5.10
  • PHP version: 8.3.14
  • Database driver & version: MariaDB 11.6.2
  • Feed Me versions: 6.6.1
@antcooper
Copy link

+1 I was just about to report the same. We can't import data related to anything other than the Title for this reason.

Image

@chrismlusk
Copy link

+1 This is a breaking change for projects that have upgraded from Craft 4 to Craft 5 and then used the merge utility to consolidate fields. There aren't any warnings (that I can find) about this issue in any upgrade guides or documentation.

@i-just
Copy link
Contributor

i-just commented Feb 5, 2025

Hi, thanks for getting in touch! Historically, the list of available match options has always been a list of all the fields (not just ones that are related to the sections/category group/etc. that are used by the relation field) that are deemed fit to be used as unique identifiers (selection of the “simple” fields). That said, with the changes in Craft 5, it can be less intuitive to use, so I just raised a PR to adjust this behaviour (more details on the PR).

@i-just i-just self-assigned this Feb 5, 2025
@svondervoort
Copy link
Author

Yeah I figured it had something to do with the Craft 5 feature about renaming fields and handles on Entry Type level.
I also thought about creating a more specific field without renaming it to use in FeedMe if necessary, but would be extra nice if it works with the way Craft 5 handles fields. So looking forward to your fixes on the PR.

@angrybrad
Copy link
Member

PR merged in and tested locally, but if someone wants to test this before the next release, that’d be great. Change composer.json to:

"require": {
  "craftcms/feed-me": "6.x-dev",
  "...": "..."
}

Then run composer update.

@rellafella
Copy link

Seem to be getting an error, screenshot attached.

Image

@tommysvr
Copy link
Contributor

tommysvr commented Feb 6, 2025

I'm getting a similar error when importing into an entries field.

$customSources = array_filter($field['sources'], (fn(string $source) => str_starts_with($source, 'custom:')));

$field['sources'] in this case is a string (*) when 'Sources' is set to All on the entries field.

@i-just i-just mentioned this issue Feb 6, 2025
@i-just
Copy link
Contributor

i-just commented Feb 6, 2025

Thanks @rellafella and @tommysvr. Both errors are actioned in a new PR.

@angrybrad
Copy link
Member

New fix in #1589 and will be included in the next 6.x release. Merged in if anyone wants to test early with:

"require": {
  "craftcms/feed-me": "6.x-dev",
  "...": "..."
}

And composer update.

@svondervoort
Copy link
Author

@angrybrad just gave the 6.x-dev a quick go and it works great :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants