Forum

API behavior change...
 
Notifications
Retirer tout

API behavior changed in version 11.0.2 ?

11 Posts
2 Utilisateurs
0 Reactions
3,128 Vu
(@bgenolini)
Posts: 45
Trusted Member
Début du sujet
 
[#9202]

Hello,
I used so far the API request Project/all to get the status of the project. Until version 11.0.1, it worked fine. With 11.0.2, I dont get the status columns (status, "en cours", etc.).
I even check them for display in the app (making sure that the status is displayed), it does not change the behavior.
I log as admin in both cases.

Did I miss something?

Thanks in advance.

Best regards,
Bernard


Bernard

 
Posté : 14/12/2023 2:35 pm
(@bgenolini)
Posts: 45
Trusted Member
Début du sujet
 

I have the same behavior with version 11.0.3


Bernard

 
Posté : 15/12/2023 12:52 pm
(@babynus)
Posts: 14952
Membre Admin
 

Hi,
There is no issue with the API, status is still returned.
 

What may happen is that you hid the status for the profile of the user used to connect to the API : if a field is not visibile through the interface for this user, it will not be visible through the API.


 
Posté : 16/12/2023 1:05 pm
(@bgenolini)
Posts: 45
Trusted Member
Début du sujet
 

The field is visible for the user in the interface but not in the API. I log as admin.
I have also checked in the screen customization that all user type have access to the status.
And indeed, I had not this behavior before the update to version 11.0.2.


Bernard

 
Posté : 18/12/2023 3:15 pm
(@babynus)
Posts: 14952
Membre Admin
 

I am almost sure the NOT display is normal, due to configuration of customisation.
You can try and comment lines 369:371 in projeqtor/api/.index.php

  if (method_exists($obj, 'setAttributes')) {
    $obj->setAttributes();
  }

Possibly it will fix your issue.
But if it does, it confirms that it is due to some customisation that field is hidden.


 
Posté : 19/12/2023 2:10 pm
(@bgenolini)
Posts: 45
Trusted Member
Début du sujet
 

I did it, without effect.
I reset the Project settings in the screen customization: no effect either

I log as admin, and I have set all the possible access in the various configuration settings. Do you see something I may miss?


Bernard

 
Posté : 19/12/2023 5:51 pm
(@bgenolini)
Posts: 45
Trusted Member
Début du sujet
 

Hi,
If I try to get the data using https, it works fine when I get a single project, but I have the issue when I use "all" the projects.

Actually, there is more than one field missing. I attached a file with the differences.The format is the following:what I get in version 11.0.1, including custom fields, followed by what I get in version 11.0.2Every time I get missing fields, I break the line and add a tab with all the missing fields. I break the line only when the field appears in version 11.0.2. Here are the first lines to illustrate:

'id', 'nsipID', 'ijcID', 'nom', 'idProjectType', 'type',
'idProject', 'est sous projet de',
'WBS externe', 'idOrganization', 'organisation', 'idCategory', 'catégorie',
'idClient', 'client', 'idContact', 'contact facturation', 'idCatalogUO',
'nameCatalogUO', 'idCalendarDefinition', 'nameCalendarDefinition', 'code projet',

Meaning that in 11.0.2, I get the fields from 'id' to 'type', then miss the fields from 'idProject' to 'est sous projet de', then get 'WBS externe' until 'catégorie', miss from 'idClient' to 'nameCatalagoUO', and so on. So it is much more than the only field I mentioned in my earlier post.

Note that some fields are not in the same order: I skipped a line in the text file to list them.

I have three lists in the text file: what I get in 11.0.1, what I get in 11.0.2 with my screen customization, what I get when I reset the screen customization. Note that the fields missings after customization are not exactly the same as those missing after resetting the customization. So it seems that the customization has indeed an effect, that seems to be not reversible.

This is produced with the modification you suggested.

Hope this helps.


Bernard

 
Posté : 20/12/2023 3:15 pm
(@bgenolini)
Posts: 45
Trusted Member
Début du sujet
 

I confirm the issue: if I do api/Project/search/idle=0 , I don't get all the fields.
But it is correct for idle=1

So I tried search/id>1 and it works... but not with >0 or >=1!


Bernard

 
Posté : 20/12/2023 9:03 pm
(@babynus)
Posts: 14952
Membre Admin
 

Very strange indeed.
I tested API Calls with criteria as you explain : I don't get any difference in the format.

Can you please check content of table extrahiddenfields ?
 


 
Posté : 23/12/2023 7:21 pm
(@bgenolini)
Posts: 45
Trusted Member
Début du sujet
 

Hello,I've checked in extraHiddenFields. I dont' understand well, but I give a comparison two files corresponding to different versions of ProjeQtOr, but not with the same active library.

  • extraHidden.prod.txt: version 11.0.1, for which we do not have this issue
  • extraHidden.demo.txt: version 11.0.2, for which we have the issue.

For instance, idProject that disappears in v.11.0.2 is not mentioned in both files.

I have tried to inspect more with the log file and with other uses just to see if there would not be any possible effect. Indeed, we have an issue due to the font that prevents us from displaying the general planning (I've seen this issue in the forum). We set the base charset in utf8mb4. The issue we have is due to
`( $from='COLLATE utf8_general_ci'; $to='';`
in  `maintenanceFunctions.ph` that generates an error
`Exception-[42000] SQLSTATE[42000]: Syntax error or access violation: 1253`.

We have a lot of French characters with accents, etc.


Bernard

 
Posté : 10/01/2024 5:21 pm
(@bgenolini)
Posts: 45
Trusted Member
Début du sujet
 

Hello,
I found a workaround: the culprit seems to be the administrative projects. If I search with /api/Project/search/idProjectType!=52', I get what I want. By removing the first administrative project, I get all the fields. We have a second administrative project: after loading it, we had many NaN instead of values.

And thanks to the forum, we found our issue with the font message error (we had to go through all the configurations lines and found an old error).

Cheers!

 


Bernard

 
Posté : 18/01/2024 5:30 pm
Share:
Retour en haut