Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API apirest.php/PluginFieldsComputermyfield/ #395

Closed
TBastien opened this issue Aug 3, 2020 · 3 comments
Closed

API apirest.php/PluginFieldsComputermyfield/ #395

TBastien opened this issue Aug 3, 2020 · 3 comments
Labels
Milestone

Comments

@TBastien
Copy link

TBastien commented Aug 3, 2020

Hi, since version 9.5 of GLPI and the update of the plugin I can't update fields via API.
I see nginx log and i have this :

FastCGI sent in stderr: "PHP message: PHP Fatal error: Cannot declare class PluginFieldsComputerutilisateurad, because the name is already in use in /var/www/.....

My python request :
requests.put('%s/apirest.php/PluginFieldsComputerpropritaire/' % urlglpi, headers = {'Session-Token':session_token,'App-Token':apptoken,'Content-Type': 'application/json'},data = json.dumps({"input": [{'id':fields_id,'items_id':id_pc, 'itemtype':'computer','plugin_fields_proprietairefielddropdowns_id':'2', 'maintenancefield':'1','dateheurefield':dateetheure } ] } ))

GLPI 9.5.1 - PluginFields 1.11.0 - debian 10.4 - php 7.3

Thanks for your help

@SebastienBatteur
Copy link

Hi,

I have the same problem with the same message.
What is the origin of the problem?

GLPI 9.5.1 - PluginFields 1.11.0 - Debian 4.19.118-2+deb10u1 - PHP 7.4.7

@eddiegordo
Copy link

Hi,
Same issue here.
GLPI 9.5.3
PluginField 1.12.0
PHP 8.0

Got it working by a editing file \plugins\fields\inc\autoload.php
In the autoload function, replaced line 57
return include($test);
with
return include_once($test);

Don't know if this is the right way, but I got no more error and the fields are getting updated using API

@KongNan
Copy link

KongNan commented Feb 20, 2021

I saw same problem in forum, and the eddiegordo's solution works for me:
https://forum.glpi-project.org/viewtopic.php?id=278854

Thank you eddiegordo, and hope this can be fixed officially

cedric-anne added a commit to cedric-anne/glpi-plugin-fields that referenced this issue Feb 22, 2021
@cedric-anne cedric-anne added this to the 2.12.2 milestone Feb 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants