6.0.0-alpha10
5/17/25

[#6192] attributes added through the hooks don't work
Summary attributes added through the hooks don't work
Queue Whups
Type Bug
State Resolved
Priority 1. Low
Owners mrubinsk (at) horde (dot) org
Requester a-dinc (at) hotmail (dot) de
Created 02/01/2008 (6315 days ago)
Due
Updated 02/06/2008 (6310 days ago)
Assigned 02/02/2008 (6314 days ago)
Resolved 02/06/2008 (6310 days ago)
Milestone
Patch No

History
02/06/2008 08:14:28 PM Michael Rubinsky State ⇒ Resolved
 
02/02/2008 01:06:15 AM Michael Rubinsky Comment #6
Assigned to Michael Rubinsky
State ⇒ Feedback
Reply to this comment
Try what I just commited. Your going to need to read the 
hooks.php.dist file to see how to define your custom field types and 
you are going to still need to add the attribute names via whups' 
admin UI.



This looks like it is at least close to what was originally inteded 
here...but at the least, it gives us *working* hooks :)
02/01/2008 08:58:07 PM a-dinc (at) hotmail (dot) de Comment #5 Reply to this comment
And what type are you supplying? You're going to have to post the
hook I think.
sorry I forgot the add the types



  if (!function_exists('_whups_hook_get_attributes')) {

      function _whups_hook_get_attributes(&$type = null)

      {

          $attributes = array( array() );

          $attributes = array(

                               array('human_name' => 'Customer Nr.',

                                                          'id' => 
'customernr_id',

                                                      'type' => 'text',

                                                'required' => 'true',

                                                'readonly' =>  false,

                                                      'desc' => 
'Customer Number',

                                                  'params' => '' ),



                               array('human_name' => 'Separator',

                                                           'id' => 
'separator_id',

                                                       'type' => 'header',

                                                 'required' =>  true,

                                                'readonly' =>  true,

                                                      'desc'  => '',

                                                   'params' => '' ),

                                array('human_name' => 'Customer',

                                                            'id' => 
'customer_id',

                                                        'type' => 'enum',

                                                  'required' => true,

                                                 'readonly' => false,

                                                   'desc'     => null,

                                                 'params'   => 
array(array('1' => 'ABC Inc.',

                                                                       
                    '2' => 'XYZ Co.'))) );

          return $attributes;

      }

  }


02/01/2008 08:49:48 PM Michael Rubinsky Comment #4
State ⇒
Priority ⇒ 1. Low
Reply to this comment
Just to summerize some discussions on IRC...



The issue is that the only thing the hook does right now is to return 
the definition of the Horde_Form field. It does nothing to retrieve 
the value from the backend.  The driver code assumes that it does. 
Letting the driver try to retrieve it won't work (at least in current 
code) since, the sql driver joins the attributes_desc table in the 
query used to retrieve the attribute values...and attributes added via 
the hook will not have an entry in that table.  It *looks* like the 
intent of the hook was to be able to add form field types other than 
text . If that's the case, I guess we can work some magic somewhere 
and make sure that the attributes_desc entries get created...



Marko? Any thoughts/input?


02/01/2008 05:54:47 PM a-dinc (at) hotmail (dot) de Comment #3 Reply to this comment
And what type are you supplying? You're going to have to post the
hook I think.
I used, text, enum, and several others. Non did work.
02/01/2008 05:40:31 PM Chuck Hagenbuch Comment #2
State ⇒ Feedback
Reply to this comment
And what type are you supplying? You're going to have to post the hook 
I think.
02/01/2008 05:09:38 PM a-dinc (at) hotmail (dot) de Comment #1
Priority ⇒ 2. Medium
Type ⇒ Bug
Summary ⇒ attributes added through the hooks don't work
Queue ⇒ Whups
State ⇒ Unconfirmed
Reply to this comment
when defining an attributes through the hook 
_whups_hook_get_attributes as in the example the form is created 
properly displaying the fields to enter the information, but as soon 
as the ticket is shown an error occurs:



A fatal error has occurred

Nonexistant class "Horde_Form_Type_" for field type ""



[line 159 of /usr/share/php/Horde/Form.php]



Till yet, i've not added database fields for any attributes to the 
whups tables since i didn't know which id it needs to have and into 
which of the whups tables it needs to go.

Saved Queries