Warning: array_fill() [function.array-fill]: Number of elements must be positive in /home/kripkorn/domains/kripkornstudios.com.my/public_html/includes/database.inc on line 241

Warning: implode() [function.implode]: Invalid arguments passed in /home/kripkorn/domains/kripkornstudios.com.my/public_html/includes/database.inc on line 241

Warning: array_keys() [function.array-keys]: The first argument should be an array in /home/kripkorn/domains/kripkornstudios.com.my/public_html/modules/user/user.module on line 502

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 /home/kripkorn/domains/kripkornstudios.com.my/public_html/includes/database.mysqli.inc on line 128

CommentFileSizeAuthor
#19 nodeactivity-valid-account.patch445 bytesgcassie

Comments

sirkitree’s picture

Priority: Critical » Normal
Status: Active » Postponed (maintainer needs more info)

From your description there is now way to tell what is going on here. None of the files referenced are Activity files, so you need to explain much better as to what steps you took to end up with this error on your screen and why you think it has to do with Activity.

parasolx’s picture

You can check it through this link:

http://www.kripkornstudios.com.my/user/parasolx

The error is appear at above of my site.

When i turn it of, then all the error disappear.

In my 2 cents, meaning this error is related with this module.

sirkitree’s picture

When i turn it of, then all the error disappear.
Thank you for giving me a clue. However, it still does not help me unless I can replicate the error. Could you provide me with a list of other modules you are currently using and maybe the steps that you went through (if any) configuring Activity module? If it simply happened as soon as you enabled it, that would also be some great information to have.

Nice looking site by the way :)

sirkitree’s picture

Also I do see the error on this user page: http://www.kripkornstudios.com.my/user/parasolx
But not this one: http://www.kripkornstudios.com.my/user/kripkorn

Is the first user user1 by chance?

parasolx’s picture

Status: Closed (fixed) » Postponed (maintainer needs more info)

kripkorn is the user1, but when i checked with some user, the error disappear, like

http://www.kripkornstudios.com.my/user/Solarize <-- no error
http://www.kripkornstudios.com.my/user/wardensmat08 <-- error appear

For Activity Module, i have enable:
1. Activity
2. Comment activity
3. User activity
4. User relationships activity
5. Voting activity

One more, when view certain user profile without login, there are no errors. but when view that same user profile while login, the error came back again.

Here is are the list of my modules install and active:

[ edited by author for security purposes ]

jaydub’s picture

the query is from the core User module specifically the user_access() function. So what it looks like is that somewhere there is a call to user_access where the $user object that is passed in does not have $user->roles array for some reason.

Now whether or not the call to user_access() is happening in an Activity module or not is less clear.

You say that when you disable Activity that the errors disappear. Can you instead disable one of the Activity contrib modules such as User Relationships Activity or Votingapi Activity and see if the errors appear? Basically we need to know if it's happening in a specific activity contrib module or not.

parasolx’s picture

i have try to disable one by one the contrib module and found that it come Activity core module.

when disable it, all error disappear.. right now i have disable the whole package of activity. you can look at this:

http://www.kripkornstudios.com.my/user/parasolx

maureentheisen’s picture

Running into the same issue on my site...thanks for your help, looks like a fantastic module.

Starminder’s picture

subscribe, same problem, started with 6.12 update

parasolx’s picture

after updating to version 6.12, yes.. the problem still happen..

i disable, uninstall, remove, downloading back, install.. and the problem still there...

especially when i enable the user activity module.

parasolx’s picture

after doing some experiment and troubleshooting regarding this module.. then i found where the problem is coming from.

it is because anonymous data.

since this module also record any activity doing by anonymous, maybe some other or this module need to join from other table. maybe the data that need to be join only available for registered user, then this error is came out.

if i delete all the activity doing by guest, then the error disappear.

but i didn't know where to fix it.. just to give a brief where the problem came from.

sirkitree’s picture

Status: Postponed (maintainer needs more info) » Active

Ah thank you parasolx - that is some very good detection work and will help us out a lot in trying to find where this is happening!

jaydub’s picture

@parasolx do you think you can generate more activity by anonymous users and try to get the error to show up again?

I'm thinking that if you get the error again that it might be in the useractivity module.

If you get the error again, can you go to the useractivity.module and comment out the function useractivity_activityapi() ?

I'm thinking that that could be where the problem lies.

parasolx’s picture

ok.. i will try it right now.. then i will update the result later.. cause i need re-enable that module..

** Updated **

I have done what you have told, the error still come out. when i disable the useractivity module, the error still happen. so i guest it not comes from contrib module, but from the core module it self. i try to search the useractivity_api in activity.module, but nothing there.

parasolx’s picture

any update regarding of this problem?

Starminder’s picture

I am getting these errors in this order:

array_fill() [function.array-fill]: Number of elements must be positive in /usr/home/hoslo/public_html/includes/database.inc on line 241.

implode() [function.implode]: Bad arguments. in /usr/home/hoslo/public_html/includes/database.inc on line 241.

array_keys() [function.array-keys]: The first argument should be an array in /usr/home/hoslo/public_html/modules/user/user.module on line 502.

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 /usr/home/hoslo/public_html/modules/user/user.module on line 502.

They come together in batches of 4 errors in the log (but in reverse order) - so array fill is first, and so on.

Would love to make this go away, let me know how I can help.

trwilson’s picture

I might be embarrassing myself here and apologize now for getting involved with something I know nothing about. I don't program and have only used Drupal 6x for a very short time to build a site for myself. That being said, I am hoping what I found may be useful to someone who understands all this stuff.

I had the same error when building a user list to be displayed on a page (that's how I found this page - I did a google search on the error msg). I read all the postings here and went back to views to tinker. What I found was that the error went away when I removed "User: Picture" from the "Fields" options. I didn't really want a user page without pics, so I went to "Filters" and filtered for "User: Picture YES" (they would have to have uploaded an avatar). The error again went away and the preview displayed correctly.

I tried to designate a default user image to see if I could then re-filter the results, but the error returned. I went to a test user I had created (without avatar), logged in as that user and uploaded a pic for "my" profile as him. Now, the user was correctly listed on the user page and still no error.

I tried to look at the examples in the above posting showing "error" and "no error" examples, but when I clicked on the "error" examples, the page seemed to display correctly - and both pages did indeed have an avatar associated with them. Perhaps it was missing at the time of post?

Ok, I promise not to get involved past this. I'm sure I have created enough snickers with my total ignorance as is, but I do hope someone that knows the connections between these might be helped a little in knowing.

Thank you all for helping to make something that is so complex and powerful, it does amazing things - and yet simple enough for someone like myself to enjoy (even if I don't "get it".

trwilson

Starminder’s picture

Thanks trwilson - I did set a default avatar for users without an avatar recently, will check to see what happens if I undo that.

gcassie’s picture

StatusFileSize
new445 bytes

try this patch on nodeactivity.module

it checks to make sure that the $user object passed to user_access in nodeactivity_nodeapi is valid.

Junro’s picture

I don't know if it could help, I've got this when I reimporter a language with l10n module.
So maybe it's nothing to do with Activity.

# warning: array_fill() [function.array-fill]: Number of elements must be positive in /home/pariscin/www/includes/database.inc on line 241.
# warning: implode() [function.implode]: Invalid arguments passed in /home/pariscin/www/includes/database.inc on line 241.
# 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: DELETE FROM locales_target WHERE language IN ('es') AND lid IN (SELECT lid FROM locales_source WHERE textgroup IN ()) in /home/pariscin/www/sites/all/modules/l10n_client/l10n_client.module on line 479.

There are similar problem with oher module like OG

see: http://drupal.org/node/480586

see also http://drupal.org/search/apachesolr_search/Number%20of%20elements%20must...

parasolx’s picture

Status: Active » Fixed

after applied the patch.. no more error came out..

thanks for the patch...

so this patch only record any activities done by registered users only.. not guest.

jaydub’s picture

Status: Fixed » Active
Scott Reynolds’s picture

Status: Active » Needs work

I believe it needs work. Though this all seems a bit strange. Why are anon users creating content and user_load still failing? Thats a bit nutty. And the user_load() should have still worked cause 0 is a valid user

if (!$user) {
  $user = drupal_anonymous_user();
} 

That should work for anon users

gcassie’s picture

in my case, it wasn't about anon users, it was about not having a uid at all; node->uid was blank. user_load will return FALSE if it can't load a user object, which happens when passed nothing:

  if (is_numeric($array)) {
    $array = array('uid' => $array);
  }
  elseif (!is_array($array)) {
    return FALSE;
  }
parasolx’s picture

Status: Needs work » Fixed

yea.. i agree.. cause when you install some additional module, it will add certain table field WHICH only point to registered users.

when it come to anon user, those field will return for FALSE value and lead of error appear.

thanks again to gcassie that make my site to use this module without any error.

by the way, it is possible to EXCLUDE the record for anon user from being displayed or recorded into database?

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

chissy’s picture

In my case the error was because some of the content was created by users who were later deleted.
I found the solution in this article https://drupal.org/node/777116

wszxg8866’s picture

这个问题是 organic groups 这个模块在捣鬼! 我在开发的时候也碰到这个喷血的问题。 决定先卸载 organic groups ,最终如何解决这个问题,正在思考中。

Status: Postponed (maintainer needs more info) » Closed (fixed)