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

REST POST /products: note_public and note_private do not work properly #14342

Closed
dpriskorn opened this issue Aug 2, 2020 · 2 comments
Closed
Labels
Bug This is a bug (something does not work as expected)

Comments

@dpriskorn
Copy link
Contributor

Bug

Dolibarr simply discards the note_private and note_public in the json and create the product with all other fields.

Environment

  • Version: 12

Expected and actual behavior

expected Dolibarr to insert the data in the database.

Steps to reproduce the behavior

insert a product with rest explorer

curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' --header 'DOLAPIKEY: ' -d '{"ref": "test3",
"label": "test",
"note": "test",
"note_private": "test",
"note_public": "test"}' 'http://dolibarr.localhost/api/index.php/products'
-> this inserts note and note_private

curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' --header 'DOLAPIKEY: ' -d '{"ref": "test3",
"label": "test",
"note_private": "test",
"note_public": "test"}' 'http://dolibarr.localhost/api/index.php/products'
-> this inserts none of them

curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' --header 'DOLAPIKEY: ' -d '{"ref": "test3",
"label": "test",
"note_public": "test"}' 'http://dolibarr.localhost/api/index.php/products'
-> this inserts "test" into note and note_private

So note_public and note_private never works. note works and duplicates into note_private.

Suggestion: remove the confusing note-field and fix note_public and note_private.

Related issue: #11447

@dpriskorn dpriskorn added the Bug This is a bug (something does not work as expected) label Aug 2, 2020
@ksar-ksar
Copy link
Contributor

Hello,

Can you check with the FIX and V13 ?

@dpriskorn
Copy link
Contributor Author

Closed as I assume it is fixed. I'm not using these fields because they don't show up on the card in the UI.
I made my own extrafields to add public and private notea as needed 😀

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)
Projects
None yet
Development

No branches or pull requests

2 participants