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

Undefined offset: 1 - Users.php: 72 #844

Closed
nicholashu opened this issue May 6, 2021 · 3 comments
Closed

Undefined offset: 1 - Users.php: 72 #844

nicholashu opened this issue May 6, 2021 · 3 comments
Assignees
Labels

Comments

@nicholashu
Copy link

nicholashu commented May 6, 2021

Description

I am unable to add users to a user relation field in an entry

Steps to reproduce

  1. Create an entry with a user field that has Admin and a group as a source
  2. Set that user field to email in feed-me when creating a new feed

Additional info

The issue exists because
$sources = Hash::get($this->field, 'settings.sources');
on line 60 of src/fields/Users.php
returns ["admins","group:xxxxxxx-xxxxx-xxxx-xxxx-xxxxxxxxxx"]
and so list(, $uid) = explode(':', $source);
is unable to set a $uid for "admins"

  • Craft version: 3.6.13
  • Plugins & versions: Feed-me 4.3.6
@nicholashu nicholashu added the bug label May 6, 2021
@tommysvr
Copy link
Contributor

Thanks for reporting this; I'm getting Undefined array key 1 - Users.php: 91 when importing to a Users field with Admin, Credentialed or Inactive selected as a Source on the field running Craft 4.4.14 and Feed Me 5.1.4.

It seems to be, as you say because it expects a UID that doesn't exist for those sources.

@i-just
Copy link
Contributor

i-just commented Jun 29, 2023

Hi, thanks for reporting! I just raised PRs to action this.

@tommysvr, thanks for reproducing and confirming the scope!

@angrybrad
Copy link
Member

Resolved in #1337 and #1338 for the next v4 and v5 releases.

Thanks, @i-just and @tommysvr!

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

4 participants