| Summary | attributes added through the hooks don't work |
| Queue | Whups |
| Type | Bug |
| State | Resolved |
| Priority | 1. Low |
| Owners | Michael Rubinsky <mrubinsk (at) horde (dot) org> |
| Requester | a-dinc (at) hotmail (dot) de |
| Created | 02/01/2008 (155 days ago) |
| Due | |
| Updated | 02/06/2008 (150 days ago) |
| Assigned | 02/01/2008 (155 days ago) |
| Resolved | 02/06/2008 (150 days ago) |
| Attachments | |
| Milestone | |
| Patch | No |
State ⇒ Feedback
Assigned to Michael Rubinsky
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 :)
hook I think.
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;
}
}
Priority ⇒ 1. Low
State ⇒
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?
hook I think.
State ⇒ Feedback
I think.
Queue ⇒ Whups
Summary ⇒ attributes added through the hooks don't work
Type ⇒ Bug
Priority ⇒ 2. Medium
State ⇒ Unconfirmed
_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.