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 »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • export hook
Pages: [1]

Author Topic: export hook  (Read 1291 times)

lcdweb

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1620
  • Karma: 116
    • www.lcdservices.biz
  • CiviCRM version: many versions...
  • CMS version: Joomla/Drupal
  • MySQL version: 5.1+
  • PHP version: 5.2+
export hook
March 28, 2011, 05:02:20 pm
just used the export hook for the first time. took a bit of time to figure out what it was giving me, how to best modify, and what I needed to send back in order to complete the export. but it worked pretty smoothly.

the one thing that is lacking is any obvious way to limit the hook. it's unlikely you'd want to run the same modification across every export.

i think the best option would be to pass the value of the saved mapping (if it exists) to the hook, or "primary fields" if the default option is used. that way i could create a mapping "XYZ" and decide that when it's used, I modify the export accordingly.

in my case, i needed to export membership values with a contact export for a specific mapping. so i really want to limit to a specific saved mapping.

i could see value re: the primary export -- the default set of fields is really cluttered with a lot of stuff that's rarely used. if i could limit the hook to just that export selection, i could decide what fields are exported by default for a given installation.
support CiviCRM through 'make it happen' initiatives!
http://civicrm.org/mih

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: export hook
March 28, 2011, 09:27:26 pm

Its a bit non-trivial change (i.e. not a 1 line or so change!)

the main issue is that at the level where the export is being done, we dont have an handle (currently) on the mapping or options selected etc. We'll need to extend the code to pass it on, and in turn we can pass it onto the hook

this happens for a few other hooks also, where having access to the context would be great. There is the "butler" project in drupal (for drupal 8) attempting to address this issue, and might be worth it for us to see what we can learn/reuse

https://drupal.org/project/butler

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

lcdweb

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1620
  • Karma: 116
    • www.lcdservices.biz
  • CiviCRM version: many versions...
  • CMS version: Joomla/Drupal
  • MySQL version: 5.1+
  • PHP version: 5.2+
Re: export hook
March 29, 2011, 05:35:02 am
i think in this case, we only have to go back one step to the form which triggers the BAO query. we could add a param to the method passed to the query and add it to the hook.

but i understand if you're looking to think about it in the bigger picture
support CiviCRM through 'make it happen' initiatives!
http://civicrm.org/mih

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • export hook

This forum was archived on 2017-11-26.