Please excuse me for being such a n00b I have no idea where to put this in the forums here. I've been working on a learning a bit about Drupal for the past couple of months and have been building a site (locally, running on Mac OS X, 10.5.x) using Acquia Drupal with a number of additional modules added and active.

Some of the modules I've been playing with in the past day include Devel, Smileys, Wysiwyg (installed CKEditor), etc. I've previously added a second admin user and yesterday added a few "random" users (with Devel) and hadn't had any issues. Now I'm attempting to add a new user (for myself), which includes all userclass permissions except admin (I've created permission sets for Editor, Author, Contributor, Moderator, etc).

When I add the new user, it is created, but I get the following message:
<strong>Fatal error: Cannot access empty property in [...]/acquia-drupal/includes/bootstrap.inc on line 718</strong>

However, the user IS created. But if I attempt to edit it, I get the same error... ditto if I try to delete the user and try again. I directly deleted the user in phpMyAdmin to see if I could replicate the problem. And it does happen again. I additionally get that error even when trying to simply view the user. I was successfully able to add users with the Devel module, yesterday. And indeed, now, after deleting the new user in phpMyAdmin, I tried adding two more random users with Devel -- which worked -- and I edited one of them to be my personal moderator account (what I was trying to create) with all user class privileges except Admin -- and editing that account threw up no such error message. It now has the username, email, password, user picture, etc, that I wanted. But I should be able to create a new user without Devel creating a random one and me then editing it. I've done so before, and have no idea what's getting in the way now.

I don't have any idea whether this is a "Drupal core" issue or related to one of the modules I have installed, nor what I can do to correct the issue. In my search through the other issues that might be related, I found two almost identical issues related to particular modules:
Fatal Errors with User Registration and Drupal 6.16! (apparently a No Case project issue)
and
Fatal error: Cannot access empty property in /includes/bootstrap.inc on line 718 (apparently a phpBBforum Integration module issue)

But I'm using neither of those modules. I have lot of modules installed now to experiment with them, some may not be fully configured... a few aren't enabled (most are)... the simplest way for me to display my "additional" modules is to copy and past the folder names from my sites/all/modules folder, perhaps:

sites/all/modules

abuse
administerusersbyrole
adminrole
advanced_forum
advanced_profile
advuser
amazon
amazon_store
author_pane
backup_migrate
badbehavior
bbcode
better_formats
captcha
contemplate
css_injector
ctools
devel
dhtml_menu
diff
dompdf
email
emfield
faq
fckeditor (disabled: Using Wysiwyg with ckeditor installed, instead)
flag
flag_form
flag_friend (turned off since I was getting query errors for missing flag_friend table, would like to fix this, too)
globalredirect
gmap
google_analytics
htmlpurifier
httpbl
image_resize_filter
imce
insert
jaikublock (not enabled)
location
login_security
logintoboggan
menu_attributes
menu_block
midnight
modr8
node_import
nodewords
panels
password_policy
password_strength
path_redirect
poormanscron
privatemsg
quicktabs
recaptcha
revision_fu
salt
scheduler
search404
seo_checklist
service_links
sharethis
site_verify
smileys
spamspan
taxonomy_title
views_bonus
wysiwyg
xmlsitemap

Of course there are also "extra" modules that are provided by Acquia Drupal:

modules/acquia

acquia_connector (not enabled)
acquia_search
admin_menu
advanced_help
apachesolr (not enabled)
calendar
cck
comment_notify
date
filefield
fivestar
google_analytics
image
imageapi
imagecache
imagefield
img_assist
jquery_ui
lightbox2 (not enabled)
link
markdown
mollom
pathauto
print
tagadelic (not enabled)
token
views
votingapi
webform

Some of the modules I have enabled are not yet fully configured, so give me warning messages on status pages, but until now, I've mostly been able to avoid "fatal" errors). If any of you can shed some light on what might be causing this problem and/or if you have suggestions about various modules you see that I'm using, (modules which may be redundant or conflicting, perhaps, even if not likely related to this issue), please respond to this thread and help out a n00b. I'm hoping to overcome this learning curve, rebuild my rusty PHP/CSS/HTML/JavaScript knowledge, and make some nice contributions to Drupal and/or sub-projects/modules/themes, etc... but at this point I'm really just trying to get past the big hurdles of learning all this stuff.

Cheers,

Lowell

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

LoMo’s picture

Title: Fatal error on attempt to add/delete new user » Fatal error: Cannot access empty property in ... /includes/bootstrap.inc on line 718 -- when adding new user
Priority: Critical » Normal
LoMo’s picture

Update: Just wanted to say that this error only seems to happen when using .../admin/user/user/create

If I log out and create a new user by "registering", the user is created. And I can edit/delete, etc, such users as well as those added with Devel. But I can't seem to properly create users through the admin interface without this error, and any users created then can not be viewed/edited/deleted without this error.

jhedstrom’s picture

Version: 6.16 » 7.x-dev
Category: support » bug
Status: Active » Needs review
FileSize
462 bytes
460 bytes

I came across this issue recently. It was caused by a user having a parameter in their data column that had an empty key:


$user->data = array(
  'foo' => 'bar',
  '' => 'some data', // It is this empty key that causes the fatal error.
  ...
);

How that empty key got there, remains a mystery, but the result is the fatal error in bootstrap.inc. Attached is a patch that will allow drupal_unpack to continue shoud such corrupt data be added by buggy modules, etc.

Since the same patch will applly to 7.x with an offset, I'm pushing this to that queue in the hopes it can be reviewed before D7 is released.

LoMo’s picture

Thank you for your reply.

Hmmm... I don't think that's the case in this situation. At least I don't see anything odd in the User data tables. But still, if I attempt to create a user using the admin function in Drupal, I get that error and can't make use of the user, though it appears to be okay in the database.

I haven't even tested Drupal 7, yet, so should say that my experience of this is strictly with Drupal 6 and I didn't see it before Drupal 6.16 (though likely I just hadn't added or enabled or upgraded a particular module yet). The other mentions I've seen of this issue were also in Drupal 6. But if you'd like to put this issue into a Drupal 7.x queue, I'll defer to your wisdom. ;-)

In my situation, it's likely a bug in a module.... But which one could take a while for me to determine. What would be cool to have is a method in core to disable/re-enable groups of modules automatically to determine whether a problem persists or has been cleared up. There was a nifty utility for classic Mac OS called ConflictCatcher, I believe, which turned on/off sets of extensions to help you determine where an incompatibility or issue lay. It also had a database of known incompatibilities, I believe, so could provide helpful tips. It would be nice to have that kind of functionality in Drupal.

jhedstrom’s picture

Priority: Normal » Critical
Issue tags: +Novice
FileSize
462 bytes

Rerolling and marking critical, since this can potentially white-screen user pages. Also adding to Novice queue as it is a fairly simple code change.

marvil07’s picture

Priority: Critical » Normal

I can not reproduce the problem. And since then I'm marking it again as normal.

It would be great if someone can tell me how to reproduce it.

If this really happens, I think we have to use !empty() instead of passing the $key as boolean.

jhedstrom’s picture

Priority: Normal » Critical
FileSize
533 bytes

Here's a test (run the user save tests test in the user section of testing). Tests won't finish since it does result in a fatal error. Then, apply the patch in #5 and the test will finish just fine. Once it has been confirmed, this test should be rolled into the patch.

jhedstrom’s picture

Also, here's the patch using !empty instead of just evaluating $key. Additionally, I added a check during user_save that would prevent an empty key from ever being written to the data array. This patch includes the test. To witness the actual fatal error, apply just the test in #7, that doesn't include the fixes.

jhedstrom’s picture

Oops, indent error. Here's the proper patch.

Status: Needs review » Needs work

The last submitted patch, drupal_unpack.767512.patch, failed testing.

jpmckinney’s picture

Priority: Critical » Normal

Nothing in core calls drupal_unpack, so this can't possibly be critical.

By the way, the changes to user.module and user.test don't apply anymore.

marvil07’s picture

I think the patch it's failing because it's make against to an old version.

Actually I see this hunk:

--- modules/user/user.module
+++ modules/user/user.module
@@ -393,7 +393,7 @@ function user_save($account, $edit = array(), $category = 'account') {
           if ($value === NULL) {
             unset($data[$key]);
           }
-          else {
+          elseif (!empty($key)) {
             $data[$key] = $value;
           }
         }

is removed by http://drupal.org/cvs?commit=344002

In the other side, If I apply only the hunk about the test it actually do not report errors on run :-S

jpmckinney’s picture

Indeed, the test is no longer relevant, given the changes in the commit you cited. I was considering making this wontfix, as drupal_unpack will only fail if a contrib module is doing something really broken.

jhedstrom’s picture

Version: 7.x-dev » 6.16

Alright, sorry for the noise. It turns out there was an issue with the git mirror I was using. However, even though the magic has been removed from D7, this is still very much an issue in D6 with, as that's where it was discovered.

LoMo’s picture

Right.... the problem I've observed is in Drupal 6.16. I still haven't had time to experiment with Drupal 7, but would like to, once this site is reasonably ready to deploy. I hope to be able to contribute to the Drupal project and modules/themes as my experience "gets there". It's been a while since I've used CVS, though, and it looks like the Drupal add-on for NetBeans isn't actively supported. I'll have to figure out a decent workflow for managing code (CVS/SVN, etc) locally and build my understanding of Drupal "standard practices" to be ready.

As far as I'm concerned (for my needs), it's not a "critical" issue (I don't anticipate creating many users in this way), but for others, with a different use case, I'm sure it is a problem.

Damien Tournoud’s picture

Version: 6.16 » 7.x-dev
Status: Needs work » Needs review
FileSize
649 bytes

drupal_unpack() is still there in D7, so rerolled here.

Gerhard Killesreiter’s picture

Status: Needs review » Reviewed & tested by the community

I got stung by this when importing some ancient user data, so yes, this is needed and works.

marvil07’s picture

Status: Reviewed & tested by the community » Needs review

Re #16: Thanks for the patch :-), but I'm wondering why not include the little test jhedstrom is proposing in the older patches.

PS: Please bring this back to RTBC if this comment is not relevant.

Dries’s picture

Status: Needs review » Fixed

Committed to CVS HEAD. Thanks.

Damien Tournoud’s picture

Version: 7.x-dev » 6.x-dev
Status: Fixed » Patch (to be ported)

Re 18: The test doesn't apply anymore (because the user modules doesn't use drupal_unpack() anymore).

Needs backport for D6.

marvil07’s picture

Status: Patch (to be ported) » Needs review
FileSize
901 bytes

Here is the patch from #9 without the test.

Thanks for the clarification Damien.

MaxWesten’s picture

Status: Needs review » Reviewed & tested by the community

Re: #21 The patch works great on D6 Thanks !

ledut’s picture

Re: #21 The patch works great on D6 for me too !
Thanks again !
it was occured editing a user with my custom module.

Gábor Hojtsy’s picture

Status: Reviewed & tested by the community » Fixed

Thanks, committed.

andypost’s picture

Status: Fixed » Closed (fixed)

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

PiNZ’s picture

I'm getting the identical error in 6.25 (just upgraded core and all modules, plus implemented BOTCHA and changed from math to Text CAPTCHA.

For me it's happening when I try to register via /user/register - once again the user is created, but no emails are sent. It also happens when as admin I go to unblock the member so a password reset can take place.
How do I apply the patch, and which one of the above do I use? (also, why wasn't this fixed in versions subsequent to 6.16?)

PiNZ’s picture

I managed to apply the patch - working fine now.