Not at all but on some User profiles the following error occurs

"warning: array_key_exists() [function.array-key-exists]: The second argument should be either an array or an object in /usr/www/users/tpkskh/modules/imagecache_profiles/imagecache_profiles.module on line 41."

Comments

andypost’s picture

Can you provide more information about conditions where you get this error?

Witch’s picture

StatusFileSize
new11.2 KB

Only on Userprofile pages. I override userprofiles with panels 2. Using an older dev version (September, 4th) of imagecache profiles with the same functions works fine.


; $Id: imagecache_profiles.info,v 1.1.4.1 2008/12/19 18:05:14 v1nce Exp $
name = Imagecache Profile Pictures
description = Utilizes imagecache presets for user profile pictures.
package = ImageCache
dependencies[] = imagecache
core = 6.x
; Information added by drupal.org packaging script on 2009-09-04
version = "6.x-1.x-dev"
core = "6.x"
project = "imagecache_profiles"
datestamp = "1252023272"

The attached Version is the named one which i downloaded in september. This dev version contains most of the new improvements. maybe you find some differences.

andypost’s picture

The main change between this versions

-    if (arg(0) == 'user' && is_numeric(arg(1))) {
+    if (arg(0) == 'user' && is_numeric(arg(1)) && (arg(2) == NULL || arg(2) == 'edit')) {

So avatars are processed if URL is like /user/{number} or /user/{number}/edit

What is your URLs that have trouble?

Another change in displaying avatars on comments preview, this is more strong check for comment render but suppose this is not your case.

andypost’s picture

Sorry, line 41 is a change for comments:

    // If viewing a comment - line 40
-    if ($account->cid) {
+    if (array_key_exists('cid', get_object_vars($account))) {

$account should be an object but error your provide said that is not object, which is strange

What is your php version?

Witch’s picture

Ah okay! Comments. I override userprofiles with panels. i think comments may occur the error because i am using content_profile and comments are displayed on profiles.

My PHP Version 5.2.11

http://www.blacksins.de

here is a Profile

http://www.blacksins.de/darkdream/75

At the moment i switched back to the attached dev version.

andypost’s picture

StatusFileSize
new7.1 KB
new837 bytes

@Buffer2k I have no ability to debug your case but I think this bug is related to some other module which pass USER not as object but array.

Please try this patch or this module (remove .txt extension)

toth_O’s picture

Hi all,
I have this error too,same things,panel whith comments on profile.

andypost’s picture

@toth_O please, try #6

toth_O’s picture

Status: Active » Fixed

Works for me.

I have changed the status to "fixed"
Don't know if it's good first time i do that.

Oh thanks you andypost.

andypost’s picture

Status: Fixed » Reviewed & tested by the community

@toth_O are you tryed patch from #6 to make it work? If patch works for you you should set status to RTBC

andypost’s picture

Status: Reviewed & tested by the community » Fixed

Commited

Status: Fixed » Closed (fixed)

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