Fatal error: Cannot access empty property

gbrussel - April 12, 2009 - 22:50
Project:phpBBforum Integration module
Version:6.x-2.0-alpha9
Component:Code
Category:bug report
Priority:normal
Assigned:mak1e
Status:closed
Description

Fatal error: Cannot access empty property in /home/*****/****/includes/bootstrap.inc on line 712

Line 712 (in bold):

<?php
function drupal_unpack($obj, $field = 'data') {
  if (
$obj->$field && $data = unserialize($obj->$field)) {
    foreach (
$data as $key => $value) {
      if (!isset(
$obj->$key)) {
       
$obj->$key = $value;
      }
    }
  }
  return
$obj;
}
?>

That function drupal_unpack is called in user_load, which is what is being called five times inside the phpbbforum.module file. I can't pinpoint exactly which one is causing the error, but clearing the cookies seems to cure the error until they try and login again, in which case the error returns.

I've debugged and traced as much code as I can follow, and I'm lost.

PHPBB is set to be the master registration system, and I've got four users who have registered thus far on the forums who cannot login now (plus about 50 users who have no issues at all). These four have no password set in the users table, but putting in a dummy password doesn't have any issues.

#1

gbrussel - April 13, 2009 - 21:59

Done some more tracking today of this particular error. It always seems to happen when I either view or edit a user whose password is not set in the users table. Meaning it hasn't sync'd up for some reason.

The line $obj->$key = $value; is trying to set the $password for the $user account, but it can't pull an null field and it's not expecting one. This function drupal_unpack() is called in the user.module on line 170, in the user_load() function. The user_load() function is called a few times in the phpbbforum.module, but the only place I can think of where it might fail is on line 2439 in function _phpbbforum_user_edit_validate($uid, &$edit) where the line is called $user = user_load(array('uid' => $uid));.

This happens when I try to view the account (http://example.com/user/71) or when I try to edit the account (http://example.com/user/71/edit). Is there some reason why the password would not get synced up? The accounts in question are not administrative accounts, they are not protected in any way, they are brand new accounts on both systems.

PHPBBForum Settings:

phpBB authentication test: Passed
Select master registration system: phpBB master
Session length: 1440
Personal display messages mode: Display private messages only
Number of online forum users: 9999
Number of recent topics: 10
Recent topics display mode: Display titles only
Recent topics word's delimiter: BR
Number of recent posts: 10
Recent posts display mode: Display titles only
Recent posts word's delimiter: BR
Number of forum's top posters: 5
phpBB user ban checking: Check phpBB bans
Display phpBBForum module messages: No
Log phpBBForum module message: No
Signatures synchronisation: Enable
Avatars synchronisation: Enable
Timezones synchronisation: Enable

I'll also provide any other information you deem necessary to help debug this issue. Thanks!

#2

gbrussel - April 13, 2009 - 23:47

Eureka moment...I poked around in phpMyAdmin and saw that for the users who were working, they had this in the "data" field:

a:1:{s:7:"contact";s:1:"0";}

Whereas broken users saw only this:

a:1:{s:0:"";s:0:"0";}

So my guess is the module isn't passing in the user data array('contact' => '0'), and this is somehow breaking the user logins. Stranger and stranger...

#3

twilliac - April 17, 2009 - 13:45

Interesting that this is showing up on the forum module.
I was having the same issue (bootstrap error) with the apply for role module when it was used on registration to select one of 2 role options.

#4

twilliac - April 17, 2009 - 14:17

For what I was talking about the same situation is present in the mysql Db
broken accts start:
a:8:{s:3:"rid";s:1:"3";s:13:"form_build_id";s:37:"form-eb8dc04ba0bfd228b2422969a19000cf"
the fine ones go:
a:6:{s:13:"form_build_id";s:37:"form-a3f7ad992c8f4d7931e66d22fbe2f3d7"

#5

merky84 - June 5, 2009 - 18:54

I have the same problem too, now I can't even delete those unusable accounts as the admin. Problem occurred as soon as I tried to create a new account. So I don't think it's anything that I could have done after I created it to trigger this bug...

#6

Redbluefire - June 28, 2009 - 16:16

I had this same error, but the patch here solved it. I haven't looked at the SQL side of things, but everything seemed fine afterward.

#7

mak1e - October 2, 2009 - 00:13
Assigned to:Anonymous» mak1e
Status:active» fixed

( $obj->$key ) this is what causing the problem (extra $ 'dollar' sign), I have changed it to ( $obj->key ) and the error ("Fatal error: Cannot access empty property") is gone, this used to work on an earlier version of PHP, I got this error when I migrated it to this version of php -v:

markguadalupe-01:~# php5 -v
PHP 5.2.6-1+lenny3 with Suhosin-Patch 0.9.6.2 (cli) (built: Apr 26 2009 22:16:23)

#8

System Message - October 16, 2009 - 00:20
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.