Menu

#206 adding device fails

1.0
closed
1
2014-11-17
2014-06-02
No

Hi,

I'm using the device tools to list all devices in my DCs. it's been fine so far.

i have 25 devices in the device table.

This morning the add device pop-up keeps on failing with "Failed to add device" with no further explanations.

Regards,

Blaise

Discussion

  • Blaise DAVID

    Blaise DAVID - 2014-06-02

    It seems that the issue is related to the custom fields in the device tools. Once my custom fields deleted (Site and Customer), everything is OK!

    Strange...

    in the custom fields tools when the error occured, i had 2 customs fields for subnets (Site and Customer) and 2 custom fields for devices (Site and customer as well).

    It would be really convinent to be able to add custom tools in phpipam in order to have custom fields as drop-down menu and not as text string.

    Regards,

    Blaise

     
  • Miha Petkovsek

    Miha Petkovsek - 2014-06-02

    Hi, maybe some apostrophe or something?

    BTW you can define drop downs for custom fields, set field type to 'set' and add drop downs for values (e.g. 'option1','option2', ...).

     
  • Anonymous

    Anonymous - 2014-10-15

    I'm having the same issue.

    When adding a device, it displays my custom fields with no issue. However, when I fill out my fields and click Add, the device fails to add with the following:

    Device add failed (OPEN)Column 'PDU' cannot be null

    PDU is a custom field that I created.

    Checking the log files does show the value is stored in the device, but when it adds it, it doesn't actually add the custom fields with the device which is why it's reporting as null.

    In fact, it only updates the fields that are non-custom. I have to then 'Edit' the device to get the proper custom fields edited.

     
  • Anonymous

    Anonymous - 2014-11-15

    I've found and fixed the issue. The issue is in ./functions/functions-admin.php. More specifically with the following line:

    if(strlen($ip[$myField['name']])==0)

    That line will always fail as you're not sending an IP to the updateDeviceDetails. You're sending a device. So, if you change the line to the following:

    if(strlen($device[$myField['name']])==0) under the $device['action'] == "add"), it will work with no issue.

     
  • Miha Petkovsek

    Miha Petkovsek - 2014-11-17
    • status: open --> closed
     
  • Miha Petkovsek

    Miha Petkovsek - 2014-11-17

    Hi, you are right, will update. Thanks

     

Anonymous
Anonymous

Add attachments
Cancel