CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Drupal Modules (Moderator: Donald Lobo) »
  • using a civicrm profile in custom module?
Pages: [1]

Author Topic: using a civicrm profile in custom module?  (Read 1705 times)

Clifford Meece

  • I’m new here
  • *
  • Posts: 15
  • Karma: 0
using a civicrm profile in custom module?
June 08, 2010, 07:31:02 am
Hi,
I've been working the last couple of days on the drupal 'petition' module.  First, I have updated the module to work with civicrm v2 api.  So now, it works, mostly.

But today I realized that only text type profile fields work.  If I use a custom data field like the multi-select, I just get a plain jane textfield. 

Sure, enough, the docs for the petition module confirm this is the case.  The reason is how the forms are built.  Essentially, the module loops through a fields array and outputs drupal form items for each field.

There must be a better way. 

Isn't there any way to just incude an entire civicrm form from a custom drupal module?  Are there any code examples of modules that do this?  Obviously some of the core features of the civicrm do this for user profiles, etc.

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: using a civicrm profile in custom module?
June 08, 2010, 09:25:54 am

check:

drupal/civicrm.module and the _user hook (insert / register / create) options

and trace the code from there to see how we insert a profile into a drupal form

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: using a civicrm profile in custom module?
June 08, 2010, 10:15:24 am

i think someone did mention this before, but a better use of your time and energy might be to contribute to one of the more recent petition things:

http://wiki.civicrm.org/confluence/display/CRM/CiviPetition. I know xavier is working hard on this and has a deliverable pretty soon. He can be found on IRC

OR

http://drupal.org/project/activism Dont know the status of this, but might be worth downloading and checking out

lobo

A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Drupal Modules (Moderator: Donald Lobo) »
  • using a civicrm profile in custom module?

This forum was archived on 2017-11-26.