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) »
  • Getting Form Values to All Hook
Pages: [1]

Author Topic: Getting Form Values to All Hook  (Read 762 times)

lkacenja

  • I’m new here
  • *
  • Posts: 18
  • Karma: 2
Getting Form Values to All Hook
July 14, 2010, 08:18:33 am
Hi I'm trying to write a custom report that adds an extensible number of custom fields to a report. I'm having trouble getting the formValues array available to the all hook. Tried using CRM_Utils_Array::value(), but can't get anything returned. Any suggestions? Thanks.
Leo Kacenjar
Web Developer
Open Media Foundation

TwoMice

  • I post frequently
  • ***
  • Posts: 214
  • Karma: 16
    • Emphanos
  • CiviCRM version: Always current stable version
  • CMS version: Drupal 7
Re: Getting Form Values to All Hook
July 14, 2010, 08:22:36 am
Hi,

Which hook are you trying to use? Is it one of these? http://wiki.civicrm.org/confluence/display/CRMDOC/CiviCRM+hook+specification
Please consider contributing to help improve CiviCRM with the Make it Happen! initiative.

lkacenja

  • I’m new here
  • *
  • Posts: 18
  • Karma: 2
Re: Getting Form Values to All Hook
July 14, 2010, 08:49:13 am
TwoMice helped me through IRC. Here is the answer: I was referencing this custom search file provided through the Civi documentation: http://wiki.civicrm.org/confluence/display/CRMDOC/Detailed+Contribution+Report+(month+or+year). There you will see the function main() which I copied. In __construct we see  $this->_formValues = $formValues;

Code: [Select]
function __construct( &$formValues ) {
         $this->_formValues = $formValues;
         ...

 $this->_formValues = $formValues; makes $this->_formValues accessible from the function all(). Thanks again TwoMice.
« Last Edit: July 14, 2010, 08:50:54 am by lkacenja »
Leo Kacenjar
Web Developer
Open Media Foundation

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • Getting Form Values to All Hook

This forum was archived on 2017-11-26.