Closed (fixed)
Project:
User Read-Only
Version:
7.x-1.3
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
18 Aug 2011 at 17:43 UTC
Updated:
28 Jun 2015 at 17:52 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
itivet commentedGet this error message after doing it
Parse error: syntax error, unexpected ')', expecting ']' in /homez.31/cliniqued/www/sites/all/modules/user_readonly/user_readonly.module on line 77So I deleted the '[' to have this line
if(isset($element[$element_value_name][0]["#field_name"])) {afterwhile I get this error message
Warning : Invalid argument supplied for foreach() dans form_type_checkboxes_value() (ligne 2233 dans /homez.31/cliniqued/www/includes/form.inc).any idea??
Comment #2
itivet commentedI get also this error message when I'm on user account
Notice : Undefined index: #field_name dans user_readonly_form_alter() (ligne 242 dans /homez.31/cliniqued/www/sites/all/modules/user_readonly/user_readonly.module).Comment #3
coderintherye commentedYou should take note that the OP's post has an error in the code, it should be:
Comment #4
Niremizov commentedThx for solution tip. I have used this code above and error was fixed. But then one more notice appeared on the users page
To fix it the same changes were made inside user_readonly_form_alter() function, line 237
Comment #5
stephenrobinson commentedI added a new user field, which doesn't show up on the config page for user_readonly, and get this error whenever someone goes to edit their profile:
Comment #6
sachbearbeiter commentedsame problem - please mark this module abandoned - so that others don't run on old errors ...
Comment #7
jyloss commentedI had the same problem: undefined index : #field_name ... and it's working now.
After analysis, the problem was for 2 new fields defined as 'Integer' (the other was defined as 'text' or 'List (text)'.
I removed the 2 'Integer' fields and I create new ones with the same name but with the type 'Text'.
-> It's working now:
- No error when I opened the confguration of the user_read_only module and I can see the 2 fields (not visible before)
- I can configure the permission for those 2 fields (visible for admin and not for the user having other role)
- When I edit an user, no error displayed and the 2 fields matches the user_read_only configuration.
Remark : In my case, there is no difference if I configure those fields as 'Text' in place of 'Integer'.
I understand that it can give a problem for other project.
Comment #8
logii commentedAttached patch for convenience sake.
Comment #10
deekayen commentedComment #12
scott.olipra commentedI received the same error, "undefined index" (several instances, and repeatably) in admin/config/people/user_readonly .
I looked at the patch in #8.
It appears to me that the same should be done in another place, to match; up in the function user_readonly_admin_settings().
I'm attaching a second patch here.