1
colossus
Bug in profile 1.51?
  • 2008/10/15 11:32

  • colossus

  • Just popping in

  • Posts: 43

  • Since: 2007/9/30


Hi:

In Profile 1.51, as shipped with XOOPS 2.3.1, I'm getting a blank page when trying to view any user's profile as anonymous user (permissions were OK prior to the update from 2.3.0 to 2.3.1).

The debug info states this:

Quote:
Fatal error: Call to a member function isAdmin() on a non-object in ..../modules/profile/userinfo.php on line 126


Line 126 in userinfo.php looks like this:

if (!$xoopsUser->isAdmin()) {


It works when registered, but throws the above mentioned error if not loggen in. Changing it to, for example, !$xoopsUserIsAdmin prevents the error, but anonymous users can then see all fields in the profile.

Regards: Colossus

2
dslchart
Re: Bug in profile 1.51?
  • 2008/10/15 12:05

  • dslchart

  • Not too shy to talk

  • Posts: 112

  • Since: 2008/9/7 1


i think is a bug through upgrading.

3
colossus
Re: Bug in profile 1.51?
  • 2008/10/16 5:49

  • colossus

  • Just popping in

  • Posts: 43

  • Since: 2007/9/30


Hi:

Quote:
i think is a bug through upgrading.


Maybe there's a bug in the upgrade, as I'm not able to make it work. But, upgrade or no upgrade, $xoopsUser is not an object when you are not logged in, and I think the error will happen in a fresh install also... Can anyone confirm?

Thanks, and regards: Colossus

4
Marco
Re: Bug in profile 1.51?
  • 2008/10/16 18:26

  • Marco

  • Home away from home

  • Posts: 1256

  • Since: 2004/3/15


confirmed, and added to SF bugtracker, thx
Do synergy or die.

5
colossus
Re: Bug in profile 1.51?
  • 2008/10/16 18:51

  • colossus

  • Just popping in

  • Posts: 43

  • Since: 2007/9/30


Quote:
confirmed, and added to SF bugtracker, thx


No, thank you all for your invaluable work.

Regards: Colossus

6
uriox
Re: Bug in profile 1.51?
  • 2008/10/28 19:17

  • uriox

  • Just popping in

  • Posts: 9

  • Since: 2005/5/26


Has anyone figured out a way to fix this? I would very much like to know how I can get this working, as I rely on the profile module a lot for my web site but I also want to use XOOPS 2.3.x

7
alfred
Re: Bug in profile 1.51?
  • 2008/11/1 20:40

  • alfred

  • Quite a regular

  • Posts: 249

  • Since: 2005/10/29


fixed in SVN

you can edit the /modules/profile/userinfo.php
on line 125
from Code
// Admin has access to all fields
if ( !$xoopsUser->isAdmin() ) {
    
$field_ids_visible $visibility_handler->getVisibleFields($thisUsergroups,$groups);
}


change to

// Admin has access to all fields
if ( !is_object($xoopsUser) || !$xoopsUser->isAdmin() ) {
    
$field_ids_visible $visibility_handler->getVisibleFields($thisUsergroups,$groups);
}

8
colossus
Re: Bug in profile 1.51?
  • 2008/11/2 9:11

  • colossus

  • Just popping in

  • Posts: 43

  • Since: 2007/9/30


Hi:

Quote:
you can edit the /modules/profile/userinfo.php


That will prevent the error, but will show all fields to the anonymous user...

9
alfred
Re: Bug in profile 1.51?
  • 2008/11/2 9:50

  • alfred

  • Quite a regular

  • Posts: 249

  • Since: 2005/10/29


as admin you see all fields.


10
colossus
Re: Bug in profile 1.51?
  • 2008/11/2 9:53

  • colossus

  • Just popping in

  • Posts: 43

  • Since: 2007/9/30


Hi:

Quote:
as admin you see all fields.


Yes, but as anonymous you shouldn't. And that's what is happening in my test installation.

Login

Who's Online

187 user(s) are online (121 user(s) are browsing Support Forums)


Members: 0


Guests: 187


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits