Add user page contains Warnings
| Project: | Domain Access |
| Version: | 6.x-2.0-rc9 |
| Component: | - Domain User |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | patch (to be ported) |
Running 6.14
I went to add a new user "Administer > User management > Users > Add user" and got the following warnings in a pink box at the top of the page:
* warning: array_fill() [function.array-fill]: Number of elements must be positive in /htdocs/drupal/includes/database.inc on line 253.
* warning: implode() [function.implode]: Bad arguments. in /htdocs/drupal/includes/database.inc on line 253.
* warning: array_keys() [function.array-keys]: The first argument should be an array in /htdocs/drupal/modules/user/user.module on line 502.
* user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1 query: SELECT p.perm FROM role r INNER JOIN permission p ON p.rid = r.rid WHERE r.rid IN () in /htdocs/drupal/modules/user/user.module on line 502.
So I proceeded to add the new user.
I received my customized welcome email.
I can login to Drupal.
But the return page after I added the user had this message in the pink box:
* warning: array_fill() [function.array-fill]: Number of elements must be positive in /htdocs/drupal/includes/database.inc on line 253.
* warning: implode() [function.implode]: Bad arguments. in /htdocs/drupal/includes/database.inc on line 253.
* warning: array_keys() [function.array-keys]: The first argument should be an array in /htdocs/drupal/modules/user/user.module on line 502.
* user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1 query: SELECT p.perm FROM role r INNER JOIN permission p ON p.rid = r.rid WHERE r.rid IN () in /htdocs/drupal/modules/user/user.module on line 502.
* warning: array_fill() [function.array-fill]: Number of elements must be positive in /htdocs/drupal/includes/database.inc on line 253.
* warning: implode() [function.implode]: Bad arguments. in /htdocs/drupal/includes/database.inc on line 253.
* warning: array_keys() [function.array-keys]: The first argument should be an array in /htdocs/drupal/modules/user/user.module on line 502.
* user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1 query: SELECT p.perm FROM role r INNER JOIN permission p ON p.rid = r.rid WHERE r.rid IN () in /htdocs/drupal/modules/user/user.module on line 502.
I disabled and enabled each Contrib Mod and determined Domain Access is the culprit.
See post http://drupal.org/node/617228

#1
The errors do not indicate which Domain Access module is causing it/if at all. When you disable DA modules one by one which one stops the message from appearing? I am guessing Domain User since it's the only user related module and your errors are related to user roles.
Do you have user 0 in your user table?
#2
Confirmed in HEAD. It is Domain User. Probably not loading some data properly on that form.
Dr. DOT. This is minor and will not harm your site.
#3
#4
Here's a patch, which adds the 'create user domains' permission to handle this case.
[The problem is that the $account is empty here. When a user registers, we have a dummy $account object.]
#5
Thanks "agentrickard".
Can't seem to 'patch' -- I'm a Drupal newbie.
Here's what I did (I'm on a Windows XP machine):
1) right-mouse clicked on your patch file (617312-user.patch)
2) Save Link As... to local machine drupal\sites\all\modules\domain\patches\
3) uploaded (FTP'd) to our web server /drupal/sites/all/modules/domain/patches/
4) SSH'd onto our web server and moved to the directory where the patch file lives
5) at command prompt > patch < 617312-user.patch [per instructions at http://drupal.org/patch/apply]
6) got following messages back from patch command:
Looks like a unified context diff.
File to patch:
Ok, now I'm not sure what to do...
#6
http://drupal.org/patch/apply
The patch does not go in the patches folder. It goes in domain/
#7
Okay, sorry...being new to Drupal, I happened to see a patches directory so I though that would be a good place to upload the file too. For future reference, is that the common place to put patches? In the contrib module root?
Secondly, I moved the patch file and retried the patch < 617312-user.patch command.
Got these messages:
Looks like a unified context diff.
I can't seem to find a patch in there anywhere.
Still unsure what to do next.
#8
http://drupal.org/patch/apply
patch -p0 < path/file.patchIf that fails, see http://drupal.org/node/60179
#9
No go.
I assumed "path" was the absolute path so my command looked like this:
patch -p0 < /htdocs/drupal/sites/all/modules/domain/617312-user.patch
(I also assumed the "0" in the -p0 argument was a zero and not a cap-O)
Got the same messages:
Looks like a unified context diff.
I can't seem to find a patch in there anywhere.
Looked at your "if that fails" link. That pertains to a Windows machine. My web server is LAMP -- Linux OS.
Let's keep it at what you mentioned earlier...that this issue is harmless. We can live with the pink warning message box. Maybe this issue can be corrected in the next update...I stay very current with all updates to CORE and CONTRIB MODS.
Thanks "agentrickard" for sticking with me on this mater.
#10
I am not really sticking with you. I can't help you learn to patch.
The patch file goes in the domain access root folder. Probably /sites/all/modules/domain
Then run:
patch -p0 < 617312-user.patchThis code is ready to be released, I'm just waiting for independent confirmation that it actually fixed your problem.
#11
Patch file was moved to /sites/all/modules/domain based on earlier suggested post.
So I ran patch -p0 < 617312-user.patch from the /sites/all/modules/domain directory.
Still get:
Looks like a unified context diff.
I can't seem to find a patch in there anywhere.
Sorry I can't provide that independent confirmation for you at this time.
#12
That first patch doesn't fully work. There are a number of modifications needed.
#13
Committed to HEAD.