i-doit / api-client-php

Easy-to-use, but feature-rich client library for i-doit's JSON-RPC API
GNU Affero General Public License v3.0
15 stars 12 forks source link

cmdb.category.create gibt deprecation warning und runtimeexception #11

Closed frisbee23 closed 5 years ago

frisbee23 commented 5 years ago

ich mach category->read(..) und bekomme ein leeres array,also mache ich category->create(...)..

dabei tritt folgender fehler auf..

ich wollte das nur grob melden, zu deiner information;

ich werd mal schauen das ich die exception abfange und einfach weitermache..

gruesse, PK

Expected behavior

creating the group membership category

Actual behavior

PHP Fatal error: Uncaught RuntimeException: Bad result: Category entry was already existing and has been updated. [This method is deprecated und will be removed i n a feature release. Use 'cmdb.category.save' instead.] in /var/www/itservices/ois/vendor/bheisig/idoitapi/src/CMDBCategory.php:104 Stack trace:

0 /var/www/itservices/ois/idoit-syncdoc.php(399): bheisig\idoitapi\CMDBCategory->create(148915, 'CCATGGROUP_...', Array)

Steps to reproduce the behavior

Environment

Question Answer
bheisig/idoitapi version 0.7
PHP version 7.2
i-doit version 1.12.1 mit hotfixes fuer api open/pro
i-doit API add-on version latest

Server logs

Excerpt taken from /var/log/apache2/error.log:

Paste logs

Excerpt taken from /var/www/html/i-doit/log/api_*.log:

Paste logs
bheisig commented 5 years ago

Sorry for the late response. Can you please provide a minimal example as source code to reproduce this behavior?

bheisig commented 5 years ago

You can avoid this deprecated method by using CMDBCategory::save() instead.

I close this issue. If there's still a problem please re-open it. Thanks.