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

Extrafield for intervention lines not working with API #30342

Closed
PikowTh opened this issue Jul 10, 2024 · 2 comments
Closed

Extrafield for intervention lines not working with API #30342

PikowTh opened this issue Jul 10, 2024 · 2 comments
Labels
Bug This is a bug (something does not work as expected) Event: DevCamp 2024 Munich

Comments

@PikowTh
Copy link

PikowTh commented Jul 10, 2024

Bug

The extrafields for intervention lines are not filled in the database via API.

Dolibarr Version

19.0.2

Environment PHP

8.0.30

Environment Database

MySQL or MariaDB 8.0.37

Steps to reproduce the behavior and expected behavior

I've add one extrafield for intervention lines (via "Interventions" module in dolibarr)
image
But i can't filled this extrafield with API, here's what i try to send
image

{
  "description": "test",
  "date": "1720598400",
  "duree": "1800",
  "array_options": {
    "intervenant_custom": "Test"
  }
}

When I try to send the JSON, I don't get any apparent error, the line is created correctly, but the extrafield isn't filled in.
image
I've highlighted where the data need to be filled

Attached files

No response

@PikowTh PikowTh added the Bug This is a bug (something does not work as expected) label Jul 10, 2024
@homer8173
Copy link
Contributor

Hello I haven't open the code but your naming doesn't follow the dolibarr rules
if you created a intervenant_custom, the naming is options_intervenant_custom
{
"description": "test",
"date": "1720598400",
"duree": "1800",
"array_options": {
"options_intervenant_custom": "Test"
}
}

@PikowTh
Copy link
Author

PikowTh commented Jan 13, 2025

Hello I haven't open the code but your naming doesn't follow the dolibarr rules if you created a intervenant_custom, the naming is options_intervenant_custom { "description": "test", "date": "1720598400", "duree": "1800", "array_options": { "options_intervenant_custom": "Test" } }

I'm sending informations via this route

image

It's the same as this post , i don't need to add "options_" in "array_options" when sending informations (like with ticket extrafields), only when retrieving informations ?.

I still tested it with "options_"

image

{
  "description": "test",
  "date": "1736774140",
  "duree": "3600",
  "array_options": {
    "options_intervenant_custom": "Test"
  }
}

Still the same problem

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug This is a bug (something does not work as expected) Event: DevCamp 2024 Munich
Projects
None yet
Development

No branches or pull requests

2 participants