On a user edit page the error Trying to get property of non-object in fckeditor_user_delegate() is given when a user with with 'access ckeditor' permissions is editing a user without this permission or when a profile has not been assigned to a role.

This is caused because the following line in ckeditor.user.inc checks access of the wrong user:

if ($type == 'form' && $category == 'account' && user_access('access fckeditor')) {

It should be:

if ($type == 'form' && $category == 'account' && user_access('access fckeditor', $user)) {

Furthermore, the $profile variable should be checked before it is used, because it can be false.

Please also see #1398900: Trying to get property of non-object when editing user with no FCKeditor access and commit 182f35d22 for the equivalent FCKeditor bug. I think this bug is also present in CKEditor 6.x-1.8 in the same form and CKEditor 7.x-1.x in a slightly different form, I suspect.

Comments

Jorrit’s picture

Status: Active » Needs review

Please take a look at this quick bug fix, it is still present.

dczepierga’s picture

Title: Trying to get property of non-object when editing user with no access or profile » [D6] Trying to get property of non-object when editing user with no access or profile
Status: Needs review » Fixed

@Jorrit, really thx for report it and solution for this bug.
I commit fix to GIT (diff).

Greetings

Status: Fixed » Closed (fixed)

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