I'm not sure if this is a problem with ckeditor.module or addressfield.module, or my own installation, but here goes.

When I added addressfield.module to my site, and added a postal address field to my user profile, things appeared to work as they should. Users could fill in the address in their own profile just fine. But then I noticed that if I tried to modify a user's profile from an admin account (including the admin's own account), when I submitted the form I got a server 500 error, with the following in the apache error log:

PHP Fatal error: Call to undefined function ckeditor_user_customize_form_validate() in <siteroot>/includes/form.inc on line 1390, referer: http://<host>/user/14/edit

The problem doesn't happen if I do any of the following

  • remove the postal address field from the user profile
  • leave the postal address in place, but disable the ckeditor module
  • add a call to module_load_include('inc', 'ckeditor', 'includes/ckeditor.user'); to the ckeditor_init() function

There's a lot of things that I don't understand about this. I don't know the exact rules that define visibility of validation functions (like ckeditor_user_customize_form_validate). If anyone can point me to where that is document, I'd be grateful. And I'm not sure if the addition I made to ckeditor_init() above is a hack, or should have been there, and was only working without it by accident. And I don't know what the addressfield.module is doing to trigger the problem. And I don't know why it seems to be ok for a user to edit their own user profile, but breaks when an admin does it.

I also haven't yet tried to duplicate this in a minimal system. Hopefully the problem/solution will be obvious to someone with more Drupal experience than myself, but if not then I'll do a minimal replication.

CommentFileSizeAuthor
#9 1052604_20110214.patch767 bytesdczepierga

Comments

dczepierga’s picture

Which module to add address field do u use?

I try this one: http://drupal.org/project/addressfield , but for me it doesn't work...

Greetings

dloone’s picture

Yes, that one. Hmmm. When you say "doesn't work", do you mean that the addressfield.module itself doesn't work for you, or that when so assembled it doesn't display the symptom that I described?

Anyway, I'll see if I can replicate the issue with a minimal system and build up from there to try and figure out what's going on.

dczepierga’s picture

Yes exactly, addressfield.module itself doesn't work... i search any configuration options to enable it or sth like that, but i can't find anything :/

goldlilys’s picture

I get this error without using addressfield module but a normal field in profile 2. Whenever I try to save my changes in profile, this error comes up.

There's definitely something wrong with ckeditor module.

dloone’s picture

Is your profile2 problem resolved by adding the call to module_load_include as I described above? It completely fixes it for me.

I'm a Java dev and new to PHP. If someone can point me to some doc that describes how Drupal/PHP figures out which files to look into to find validation functions would be much appreciated.

dczepierga’s picture

I try to reproduce this with last stable Druapl 7, last dev version of CKEditor module and everything works for me...

Which version of D7 and CKEditor module do u use? Do u have any additional modules installed?

Greetings

goldlilys’s picture

@#5

adding the call to module_load_include above did fix the problem ... but there might be some permission issues here since that same function is also called in ckeditor_form_alter . Would this mess up any part of ckeditor?

Or the condition on line 184

if ( $form_id == 'user_profile_form')

is not working properly and hence module_load_include('inc', 'ckeditor', 'includes/ckeditor.user'); doesn't get fired when user_profile_form doesn't exist.

solide-echt’s picture

FYI: I was having the same problem as reported here with core D7 and a user profile with single text fields only that have plain text as set within the content types. Adding a new user worked fine but when I wanted to edit the profile I ran into this error. I switched to the current dev release but that didn't change the behaviour.
After adding the call to module_load it worked. Don't know why though ;-)

dczepierga’s picture

Status: Active » Fixed
Issue tags: +D7, +#d7ux, +ckeditor-7.x
StatusFileSize
new767 bytes

I make patch for it and commit it to CVS.

Please check the latest dev release and let me know if you notice any poblems with it. Remember to clear Drupal cache and browsers cache before testing.

Status: Fixed » Closed (fixed)

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

RoiDanton’s picture

Status: Closed (fixed) » Active

I got the same error when I try to activate a user or when I try to change my profile.
My users are not affected only the admin role has this problem.
I updated from the stable to the dev release but I still get this error.

Any idea what I can do?

Thanks!

dczepierga’s picture

Status: Active » Closed (fixed)

@RoiDanton, if u have problems pls open new issue and write everything with details - version of CKEditor module, plugin, installed modules in D7, all this information help us to find bug and fix it.

Next time pls don't open old closed issue, which was fixed and confirmed that it works... probably u do something wrong or u find new bug, so it's better to create new issue.
I wait for new issue with more details and i closed this issue again.

Greetings