editing Access control kit realm (integer) field leads to notice
Notice: Undefined index: instance in profile2_form_field_ui_field_edit_form_alter() (line 792 of E:\xampp\htdocs\newfolder\profiles\..\modules\profile2\profile2.module).

CommentFileSizeAuthor
#1 undefined-index-1631166-1.patch662 bytesmuriqui
test.PNG11.81 KBkaizerking

Comments

muriqui’s picture

Title: Access Control Kit:profile2 error » "undefined index: instance" when field is locked
Project: Access Control Kit » Profile2
Version: 7.x-1.x-dev »
Status: Active » Needs review
StatusFileSize
new662 bytes

I think that's a bug in Profile2... Their _form_alter() is comparing against an array value that doesn't necessarily exist. I'm assigning this to Profile2's queue and attaching a patch to fix the issue.

muriqui’s picture

Project: Profile2 » Profile 2
Version: » 7.x-1.x-dev

whoops, wrong issue queue... Apparently, there's a "Profile2" and a "Profile 2"...

tinefin’s picture

Status: Needs review » Reviewed & tested by the community

Works for me - profile2-7.x-1.2

Thanks!

kaizerking’s picture

that works plz commit

tobiasb’s picture

Works also for me in 7.x-1.2.

joachim’s picture

Status: Reviewed & tested by the community » Needs work

I think the better fix would be to lift the instance from $form['#instance'], which is always set.

alamp’s picture

Issue summary: View changes

@muriqui Thanks, it works fine with Profile 2 (7.x-1.3)

maddentim’s picture

I believe this issue is now fixed by this duplicate issue: https://www.drupal.org/project/profile2/issues/2166431

The patch is slightly different with the use of a !empty instead of isset but should yield the same result.