Posted by decibel.places on April 25, 2010 at 5:06pm
6 followers
Jump to:
| Project: | Drupal core |
| Version: | 6.16 |
| Component: | user system |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Issue Summary
getting a warning (but it does not affect usability)
fixed it by changing user.module line 511 from
return isset($perm[$account->uid][$string]);
to
return isset($perm[$account->uid]);
doesn't seem to break anything...
Comments
#1
What does this have to do with APK? User module is part of core.
Michelle
#2
actually, it gives anonymous users admin access - not a good idea =(
so I'm back with
return isset($perm[$account->uid][$string]);and the warning, which seems a lesser evil:
warning: Illegal offset type in isset or empty in unique_site_stuff /modules/user/user.module on line 511.#3
And you still have given me no indication of what this has to do with APK.
Michelle
#4
Hey Decibel;
What version of PHP are you running. I recall seeing a few things like that with 5.3.x which is not supported by Drupal 6 (due to some syntax changes).
#5
well, it's a hunch - because APK affects the user profile
I rolled back to a config before I installed APK with Backup & Migrate and did not get the warning when editing the (standard) profile
the warning is displayed on edit profile
I cannot pinpoint exactly when the warning started, though, so it is possibly unrelated to APK
PHP is 5.2.13
********************
unable to determine exact cause, I'm just hiding the warning with CSS
body.page-user div.messages {display: none}#6
Well, it does, yes, but so do many other modules. At a minimum, CTools, Panels, Views, and CCK. Then there's Author Pane, all the helper modules that Author Pane uses, User Relationships, FBSS... I mean, it could be anything. And APK itself doesn't do anything with permissions. Without more info, there's nothing I can act on here and it's premature to assume it's a bug in APK.
Michelle
#7
You keep editing your posts after I reply. If it's an issue with editing the profile, then it's definitely not APK. APK is about displaying the profile.
Michelle
#8
So it's probably not APK...
any other ideas for warning?
warning: Illegal offset type in isset or empty in ... /modules/user/user.module on line 511.#9
Hey Decibel, are you using content profile, or regular drupal profiles?
#10
I am using the Advanced Profile Kit with Content Profile
#11
problem is that CSS code suppresses all messages on user pages, including notification that a user name is already taken, required fields etc.
so I am back with the warning on user profile edit - bummer =\
#12
trying some tshooting on these values, which seem pretty obscure to me
print_r(isset($perm[$account->uid][$string]));
value at top of page: 11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
and
value at top of content: 111111111111111111111111111111
(ok, that's a lot of ones: isset, right?)
and
print_r($perm[$account->uid][$string]);
value at top of page: 4449511851684430544384446432525354030301464428064207435944287287287287287287287287287287287287287287287287287443044444432319114631311463535114403532326326265034353053083063053053053053053073053053053053063231463535353535353532335413263262653263262653263535289326326265326326265414135353535354435114114326213340441143251141141143532534343413811432518011418118132532532562114114114114114114114325301141144040401143254111411432540442583251144465651141143256332532511432511432532532532532532532532532532532532532532532532532532532532532532532532532532532532532532532532532532532532532532532532532511344190444430520644441904440444419027253264444443225365444444305445844305356061606132632626511332632632632335493450343434343434305343073073073073073074454355656575661616161595861616061616161616160616161616161161634212121326326286325325286325325325325325286325325325325325325325325325286325325325325325325325325325286325325325325325325325325325325325325325325325325325325286325325325325325325325325325286325325325325325325325325325286325325325325325325325325325286325325325325325325325325325286325325325325325325325325325286325325325325325325325325325286325325325325325325325325325286325325325325325325325325325286325325325325325325325325325326286325325325325325325325325325325325325325325325325325325325325325325325325325325325325325325325325325325325325325325325325325325325325325325325325325111111111127527527527527516716716716628728728728728728728728728724024024024024024024124124124124132632634404040402655178181326326326326326326326326326326326326326326326151151151151151151151151151151151343263264435190190190190190187187187187187187187343434343434343419437343434343237247343737323237323222462462462462463513131313131313131313131313131313131313150242424241751751752626262620220220220220234343430931031030920120120131020229320134343434343434343434343434343434343434343434363636363636282827628282892892892892642892892891435363647343426262655343514634341491491492863434343434343434341571823417417417417417434343425252525252618418418418418434343434343420420820834342472472472472472473431342422452422422422422423434343440344434269269269269343435256322322322322322354343434325225225225225225215618634434425825825825825843254254254254443444444444444444238238238238238238238238238238238238
and
value at top of content: 441904444305206444419044404444190253264444443225365444444305445844305
huh?
#13
ok I'm back with the hiding strategy
<!-- hide user.module warning on user edit page --><script type="text/javascript">$("div.messages:contains('Illegal offset type in isset or empty')").hide();</script>
at the end of theme page.tpl.php just before
</body>does the trick without affecting other warnings and errors on user registration etc#14
Hi,
Today I have noticed that this warning is about the access permessions. Here is my scenario and fix for this issue, I have faced today.
I have custom module which contains below code:
$items['node/%node/html'] = array('title' => 'Bla Bla',
'page callback' => 'bla_bla',
'page arguments' => array(1),
'access arguments' => array(1),
'type' => MENU_LOCAL_TASK,
'weight' => 2,
'file' => 'blabla.pages.inc',
);
That code was causing the error. Actually the problem is about access arguments suplied. When an admin user tries to access that page everything is ok. when an autenticated user tries to access that page they got the illegal offset error.
'access arguments' => array("access printer-friendly-version");When I changed the access arugments to a known permission, everything works fine.
I can suggest you check the permission settings and/or the modules that you are using might have a similar issue as I have mentioned.
PS: If you are having this warning users may not see something what they normally see on the pages. Warning will als disable the page/content which is causing this message.
#15
Hi, all,
About this warning message, I had a experience and I would like to say if you encountered problem with this some time, maby it was because of your (or other's) module misused access control, just like my case.
When I was developing a module with the views handler dealing with a link, "Illegal offset type in isset or empty in user.module" troubled me.
I checked the access controle, I finally found out I simply used user_access() like
if (!use_access('node')) {return;
}
I observed user.module, and set all possible permission with node, the error message was still there. Then I made my access function and permission string, and use it as
if (!my_node_access('my permission string',$node)) {return;
}
The problem gone!
Acording to the parameters in signature:
$string The permission, such as "administer nodes", being checked for.I think we need take care our permission string some time.