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) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • CiviCRM Field Storage Engine for Drupal -- Proof of Concept
Pages: 1 [2]

Author Topic: CiviCRM Field Storage Engine for Drupal -- Proof of Concept  (Read 4762 times)

totten

  • Administrator
  • Ask me questions
  • *****
  • Posts: 695
  • Karma: 64
Re: CiviCRM Field Storage Engine for Drupal -- Proof of Concept
August 09, 2012, 07:01:26 pm
I'm a bit of a Drupal outsider, but I think I have a vague idea of how this would let Drupal devs use more of their tricks with Civi data. A few questions:

1) The example module makes a rich content type ("civicrm_bio") and binds its data to civicrm_contact. This forum thread touched on the idea of implementing a UI to design new content-types with Civi-bindings. I wonder if a possible middle-ground step would be to define a static list of content-types based on core CiviCRM entities ("civicrm_contact", "civicrm_event", "civicrm_activity", "civicrm_case", etc). It wouldn't let you customize the content-model in Drupal, but it might still expose the content-model for purposes of layout/display/editing.

2) Reading the code, it seems like "civicrm_bio" is basically a singleton type -- ie you would create a single node of that type and then hyperlink everyone to it -- there wouldn't be any point in making multiple bio nodes. (Because they'd all display the same data -- based off the current user.) Is that read correct?

3) This module seems to build off the 'node' entity, which has a different namespace (ie nodes.nid) than Civi's entities (ie civicrm_contact.id), and it seems likely to create issues with mapping IDs. Would it make sense to define a new 'entity_type' for civicrm_contact -- which would allow it to use the same IDs as Civi? Would that still work cleanly with the rest of the D7 tooling (eg Display Suite)?

4) As a general matter, how far off do you think this is from being "good"? I don't know if anyone wants to sponsor this, but if we had a ballpark then maybe eventually something could come together.

Matt2000

  • I post frequently
  • ***
  • Posts: 288
  • Karma: 27
    • http://www.ninjitsuweb.com
Re: CiviCRM Field Storage Engine for Drupal -- Proof of Concept
August 09, 2012, 07:42:22 pm
1.) Yes, that would be an obvious first step toward making something useful for non-programmer end users. I'm more interested in building a toolkit for Drupal developers. Once that's in place, a Feature that deos what you suggest would be trivial, so it's not really much of a middle-ground step, though I guess we could skip some UI work.

2.) No. IIRC (I'm not looking at the code right now), the proof-of-concept should cause the node to display the contact data for the user who created the node. So each user would have their own node. It's like a civicrm-based alternative to Node Profile module. Either way, the concept is not limited to any kind of Singleton usage. My next step would be to implement the ability to associate a node with any given contact. At that point, Nodes & Views would replace CiviCRM Profiles for building Public Directories and search interfaces.

3.) No, civicrm_bio uses nodes because it's the most obvious kind of demo, but the Field Storage engine makes no assumptions about entities. You could already use this same code to add Contact Fields to any Entity, e.g., Users, Taxonomy Terms, or your own custom entity. However, I suspect most uses cases will want to use Nodes anyway, because it has the most potential modules for adding functionality currently, and a good, mature  security model for access control via other modules or relatively simple code.

4.) Good for who? In a week or two (maybe 3 or 4 weekends for me), it could be solid for most CiviCRM data for use by Drupal developers who want to use CiviCRM fields in Entities without having to use any CiviCRM APIs. That could probably also include some basic UIs for point-and-click users, but in order to get something as complete & flexible as Webform CiviCRM, we're probably looking at 100-200 hours, which means early to mid 2013 if I'm doing it myself on the weekends. With $10-20k, I could probably hire a Jr. Developer to help me get it done by December, probably including a module to provide the out-of-the-box content types you suggest in #1.

Anyway, if anyone does want to sponsor, before I take anyone's money, I will develop a full written spec and guarantee delivery of a minimal set of features from that spec. (i.e, the spec might include some 'nice to have' but not promised features. But the promised features WILL be delivered.) But I also want to be clear that I'm not committing to on-going support & maintenance. If the module ends up being incompatible with CiviCRM 5.0 or whatever, it will be up to someone else to upgrade it or sponsor the upgrade.
Drupal/CiviCRM micro-blogging http://twitter.com/matt2000

Ninjitsu Web Development http://www.NinjitsuWeb.com/

totten

  • Administrator
  • Ask me questions
  • *****
  • Posts: 695
  • Karma: 64
Re: CiviCRM Field Storage Engine for Drupal -- Proof of Concept
August 09, 2012, 08:52:01 pm
OK, thanks.

jhofer

  • I’m new here
  • *
  • Posts: 23
  • Karma: 0
  • CiviCRM version: 3.x
  • CMS version: Drupal 6.x
  • MySQL version: 5.x
  • PHP version: 5.x
Re: CiviCRM Field Storage Engine for Drupal -- Proof of Concept
August 26, 2012, 05:38:00 pm
 Great concept... recently I worked on a project that intergrated drupal nodes with civicrm contacts.  I ended up using contemplate module which allowed me to pull in fields from drupal and civi using the API.  I used Contact Reference to link the node to its corresponding civi contact.

Its not ideal... the process of creating a new entity requires creating a node in drupal, a contact in civi, and then cross referencing them using the ccontact reference (in drupal) and a custom field in civi (a link to the drupal node allowing for civicrm views lists to link back to drupal nodes).

http://forum.civicrm.org/index.php/topic,23560.msg99250.html#msg99250

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: CiviCRM Field Storage Engine for Drupal -- Proof of Concept
January 11, 2013, 05:19:50 am
OK - I  just wanted to add a cross-reference to this since it's kind of related - I have looked a bit at exposing civicrm as an entity

http://forum.civicrm.org/index.php/topic,27227.msg116596.html#msg116596

Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

Pages: 1 [2]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • CiviCRM Field Storage Engine for Drupal -- Proof of Concept

This forum was archived on 2017-11-26.