Needs review
Project:
Drupal.org Testing
Version:
5.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
14 May 2007 at 03:49 UTC
Updated:
12 Oct 2008 at 17:10 UTC
Jump to comment: Most recent file
Comments
Comment #1
webchickNot sure why this doesn't work, but it should be pretty close:
Comment #2
sirkitree commentedanyone ever figure this out? I'm trying something similar, using macro module to try and create categories and change settings, but it looks like contact module does some arg() checking in the _submit handler and that is why the INSERT is not happening.
Comment #3
aclight commented@sirkitree: Thanks for the information.
Attached patch successfully creates contact information and is based on webchick's code in comment 1. It gets around the problem in contact_admin_edit_submit() by doing direct db manipulation. I wrote an extensive comment about why it's necessary and also noted that I don't believe this will be necessary in the D6 version of the profile, as it looks like contact_admin_edit_submit() no longer uses arg().
Those of you with eagle eyes and who read the messages after installation might notice that the following looks a bit weird:
Mainly that the contact is updated before it is added. This again is due to the strange behavior in contact_admin_edit_submit(), and the call to drupal_set_message() that says a contact has been updated isn't dependent on the contact actually being added in the db_query() call in the line above.
I don't think there's any way around this unless we go without calling drupal_execute() at all in the D5 version of the profile. Personally, I would say to just live with those messages looking a bit strange for now.