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 2012-03-20 22:54:23

aherrera
Member
Registered: 2012-03-20
Posts: 6

Generic Object Dropdown missing index error

So I have interger, text boxes, and all the other things working except dropdowns.

$GO_FIELDS['plugin_genericobject_tech_id']['name']= 'Who Has I';                                       
$GO_FIELDS['plugin_genericobject_tech_id']['field']='tech';
$GO_FIELDS['plugin_genericobject_tech_id']['input_type']='dropdown';
$GO_FIELDS['plugin_genericobject_tech_id']['dropdown_type'] = 'global';

It creates the drop down and it has the + sign next to it but when I click it to add things to the drop down it doesn't work in debug mode I get this:

PHP Notice: Undefined index: id in /glpi/inc/commondbtm.class.php at line 1695
PHP Notice: Undefined index: comment in /glpi/inc/commondropdown.class.php at line 184


I know I'm getting something wrong. I have this in the field.constant.php file
I have a few dropdowns to add to this.
The Wiki was no help to me
I'm running glpi 80.70 and generic object 2.0.2

Offline

#2 2012-03-21 00:05:40

wawa
GLPI-DEV
From: Montpellier / France
Registered: 2006-07-03
Posts: 6,019
Website

Re: Generic Object Dropdown missing index error

hi
try to remplace plugin_genericobject_tech_id by plugin_genericobject_techs_id

Offline

#3 2012-03-21 01:35:33

aherrera
Member
Registered: 2012-03-20
Posts: 6

Re: Generic Object Dropdown missing index error

18kia9.png


This is what happens when I try to add something to it. I tried changing the techs thing ty wawa but it didn't work
usually there's an add button but i'm getting nothing.

Offline

#4 2012-03-21 01:39:41

aherrera
Member
Registered: 2012-03-20
Posts: 6

Re: Generic Object Dropdown missing index error

11ueohu.png
This is a bit closer look

Offline

#5 2012-03-21 10:33:44

wawa
GLPI-DEV
From: Montpellier / France
Registered: 2006-07-03
Posts: 6,019
Website

Re: Generic Object Dropdown missing index error

there's something wrong in the code somewhere
I've opened a new ticket https://forge.indepnet.net/issues/3400

I'll try to fix it soon

Offline

#6 2012-03-26 15:09:15

guilhas
Member
Registered: 2012-03-26
Posts: 1

Re: Generic Object Dropdown missing index error

hello

In the object field setup we have

Label                             Name in DB

Creation date           expirationdate
Expiration date           creationdate


And we would like to have notifications in case of object expiring

Thanks



//EDIT
if i change this file "field.constant.php"

trading the 30 with the 31 and vice versa, it looks correct, but i will leave it since i don't know the implications it might have..

$GO_FIELDS['creationdate']['name']       = $LANG['genericobject']['fields'][31];
$GO_FIELDS['creationdate']['input_type'] = 'date';

$GO_FIELDS['expirationdate']['name']       = $LANG['genericobject']['fields'][30];
$GO_FIELDS['expirationdate']['input_type'] = 'date';

Last edited by guilhas (2012-03-26 18:19:23)

Offline

#7 2012-03-27 00:42:32

aherrera
Member
Registered: 2012-03-20
Posts: 6

Re: Generic Object Dropdown missing index error

Okay so i figured out the problem

$GO_FIELDS['plugin_genericobject_tech_id']['name']= 'Who Has It';                                       
$GO_FIELDS['plugin_genericobject_tech_id']['field']='tech';

should be

$GO_FIELDS['plugin_genericobject_techtypes_id']['name']= 'Who Has It';                                       
$GO_FIELDS['plugin_genericobject_techtypes_id']['field']='tech';

It needed "types" need to be added to the type.

I do have a question is there a way to get rid of names and comments. I don't needthose fields or could i even rename them?

Offline

#8 2012-03-27 02:00:58

aherrera
Member
Registered: 2012-03-20
Posts: 6

Re: Generic Object Dropdown missing index error

guilhas wrote:

hello

In the object field setup we have

Label                             Name in DB

Creation date           expirationdate
Expiration date           creationdate


And we would like to have notifications in case of object expiring

Thanks



//EDIT
if i change this file "field.constant.php"

trading the 30 with the 31 and vice versa, it looks correct, but i will leave it since i don't know the implications it might have..

$GO_FIELDS['creationdate']['name']       = $LANG['genericobject']['fields'][31];
$GO_FIELDS['creationdate']['input_type'] = 'date';

$GO_FIELDS['expirationdate']['name']       = $LANG['genericobject']['fields'][30];
$GO_FIELDS['expirationdate']['input_type'] = 'date';

Okay so from my experience you don't need $LANG... all you need after that equals sign is the name you want the field to be unless you're supporting multiple languages.  so if you look at my code

$GO_FIELDS['plugin_genericobject_techtypes_id']['name']= 'Who Has It';                                       
$GO_FIELDS['plugin_genericobject_techstypes_id']['input_type']='dropdown';

the 'who has it ' is all you need.

Offline

#9 2012-03-27 02:01:46

aherrera
Member
Registered: 2012-03-20
Posts: 6

Re: Generic Object Dropdown missing index error

By the way  I meant this not the one with field I was removing that and pasted the wrong line. my bad

$GO_FIELDS['plugin_genericobject_techtypes_id']['name']= 'Who Has It';                                       
$GO_FIELDS['plugin_genericobject_techstypes_id']['input_type']='dropdown';

Offline

Board footer

Powered by FluxBB