You are not logged in.

Announcement

 Téléchargez la dernière version stable de GLPI      -     Et vous, que pouvez vous faire pour le projet GLPI ? :  Contribuer
 Download last stable version of GLPI                      -     What can you do for GLPI ? :  Contribute

#1 2016-02-24 23:51:22

mghesquiere
Member
Registered: 2016-02-24
Posts: 2

[SOLVED] Unable to enter dropdown elements for generic object

Using GLPI 0.90.1 with the Generic Objects Management plugin I can create a new object and define a dropdown field. However, when I wish to add items to the dropdown list the form does not include a "Save" button and if I hit enter to try to save the entry that way I get "The action you have requested is not allowed."

A sample field definition in .../files/_plugins/genericobject/fields/newtype.constant.php for new object "Newtype" is:

<?php

global $GO_FIELDS, $LANG;

$GO_FIELDS['plugin_genericobject_newfield_id']['name'] = 'Drop Down Field';
$GO_FIELDS['plugin_genericobject_newfield_id']['field'] = 'ddfield';
$GO_FIELDS['plugin_genericobject_newfield_id']['input_type'] = 'dropdown';

?>

Note that using a built in field such as "Model" does work.

Evidently I've missed something, but can't figure out what.

Last edited by mghesquiere (2016-03-02 02:11:08)

Offline

#2 2016-03-02 02:10:33

mghesquiere
Member
Registered: 2016-02-24
Posts: 2

Re: [SOLVED] Unable to enter dropdown elements for generic object

After digging around I found out that if you add the word "type" and pluralize the field portion of the index for the "name" and "input_type" entries it works. So the example changes to:

<?php global

$GO_FIELDS, $LANG;

$GO_FIELDS['plugin_genericobject_newfieldtypes_id']['name'] = 'Drop Down Field';
$GO_FIELDS['plugin_genericobject_newfield_id']['field'] = 'ddfield';
$GO_FIELDS['plugin_genericobject_newfieldtypes_id']['input_type'] = 'dropdown';

?>

Offline

#3 2021-05-11 17:48:41

SibVal
Member
Registered: 2021-04-23
Posts: 1

Re: [SOLVED] Unable to enter dropdown elements for generic object

mghesquiere wrote:

After digging around I found out that if you add the word "type" and pluralize the field portion of the index for the "name" and "input_type" entries it works. So the example changes to:

<?php global

$GO_FIELDS, $LANG;

$GO_FIELDS['plugin_genericobject_newfieldtypes_id']['name'] = 'Drop Down Field';
$GO_FIELDS['plugin_genericobject_newfield_id']['field'] = 'ddfield';
$GO_FIELDS['plugin_genericobject_newfieldtypes_id']['input_type'] = 'dropdown';

?>

Thank you!  This saved me a couple of hours

Offline

Board footer

Powered by FluxBB