TeemIp / teemip-core-ip-mgmt

Core modules of TeemIP, a WEB based IP Address Management tool
https://www.teemip.net
GNU Affero General Public License v3.0
19 stars 12 forks source link

Error: Unknown attribute request_creation_ipv4_offset from class IPConfig #7

Closed annProg closed 4 years ago

annProg commented 4 years ago

When use REST/JSON Service, operation is teemip/pick_ip_address_in_subnet, will show error:

{
  "code": 100,
  "message": "Error: Unknown attribute request_creation_ipv4_offset from class IPConfig"
}

grep code, IPConfig didn't define the attribute request_creation_ipv4_offset.

# find ./ -type f |xargs grep "request_creation_ipv4_offset"
./teemip-webservices/main.teemip-webservices.php:                           $sParameter = ($sParentClass == 'IPv4Subnet') ? 'request_creation_ipv4_offset' : 'request_creation_ipv6_offset';

Version info

xtophe38 commented 4 years ago

There is actually a bug with that operation : it requires the module 'IP Request Mgmt' to be installed in order to properly work. Indeed, this extension is the place where the attribute 'request_creation_ip_offest" is defined. So, until it will be corrected in next TeemIp release, I suggest you to install the extension (available on GitHub, TeemIp's wiki or iTop's Hub), even if you don't use it.

Alternative is to use the latest code for TeemIp's web services as correction has already been commited.

annProg commented 4 years ago

@xtophe38 thanks!