I am in the process of integrating my Drupal 6.17 site with an existing SMF forum.
At this stage my Drupal admin login is synchronised with the SMF admin login. So if I login to Drupal site it logs me in to the SMF forum. And all links to the forum from Drupal site are working

Have created another user in the SMF forum. It shows in the Drupal user listing as well.
Now if I attempt to login to my Drupal site with this user id I get the following error.
Fatal error: Cannot access empty property in /var........../includes/bootstrap.inc on line 795

I chanced upon http://drupal.org/node/858916. Accordingly I edited bootstrap.inc on line 795 so that the code was changed to

 foreach ($data as $key => $value) {
      if (!isset($obj->$key)); {
/*        $obj->$key = $value;*/
      }  

When this did not solve my problem, I reverted the code to

   foreach ($data as $key => $value) {
      if (!isset($obj->$key)) {
        $obj->$key = $value;
      } 

But now if I am not logged in (as admin), the link to http://www...../smf/index.php gives a 500 Internal Server error.
When I login as admin the same link (within the drupal site) opens the forum and the admin is logged in there as well.
Have deleted all cookies and cleared cache.
I wonder if the module code makes any changes to the forum code.

Can someone help solve all this and help integrate SMF please.

Comments

vivdrupal’s picture

Title: Does the module code make any changes to the forum code » Fatal error: Cannot access empty property in /var........../includes/bootstrap.inc on line 795
vivdrupal’s picture

Editing the line 795
$obj->$key = $value;

to the following solved my problems.
$obj->key = $value;

Now logging in to either Drupal or SMF logs the user to the other.

I got my hint from the following link
http://www.phpfreaks.com/forums/index.php?topic=242719.0

Hope this solution helps some one in need!

jazzitup’s picture

Status: Active » Fixed

This issue has been resolved and commited to the most recent version of Drupal 6.

bootstrap.inc

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

Status: Fixed » Closed (fixed)

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