-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
NEW: API setup update extrafields from name, elementtype and json #29273
NEW: API setup update extrafields from name, elementtype and json #29273
Conversation
This is the json I've tested it with, and it ignores the fields in the json that is not specified in the function
|
@eldy I think that the conflicts are fixed now, as for the POST I would like to re-make it in the style of delete and update, meaning attrname and elementtype in the url, the rest in json in the request_data |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For name of column or tables db->sanitize is better then db->escape
@eldy should be sanitized now, and that one phan error I do not understand because it is not in a file I changed? |
@JonBendtsen replace just "* @param string $useempty....." with "* @param int $useempty...." |
@hregis for the phan error in a file I did not change? |
@JonBendtsen phan check is completely alien to me! I don't know how it decides to check a file at one time and not at another... ;-) |
@JonBendtsen maybe @mdeweerd can answer this question ! ;-) |
At the time of posting this comment the contents of the changes to allow for updating has been copied to #29270 where there is also the additional creation of extra fields. |
@JonBendtsen @eldy just waiting integration of #29283 and after merge develop branch in your PR branch |
@hregis okay, I'll wait for #29283 too and then merge develop into my branch. (Do you guys have a chat where you're hanging out since you have that kind of information?) |
@JonBendtsen there must be a conversation channel but I don't remember which one... I'm old school and all this is beyond me and I don't have the time to take the time anymore... but I can help you on github if you put me in the "@hregis" dialog |
@hregis it is probably in French which I don't understand, so it would probably not be that helpful for me |
A far as I see the integration of the commit 3d2a018 brought the following phpdoc that I think is now fixed. * @param string $useempty 1=Add an empty value in list, 2=Add an empty value in list only if there is more than 2 entries. So I probably was invalid the develop branch as well. In that case the issue in the develop branch propagates to the PR. |
Hello, I did a grep on the entire dolibarr-20.0.2 file and the only line I found containing "IF EXISTS" is this one in htdocs/core/class/extrafields.class.php : |
When I look at the code for the first occurence which matches your error message, the "DROP INDEX" is supposed to undo the create index - however the |
@MarcVJ do you get a different result if you edit the line a little? from: to: |
I think it has to be:
|
@mdeweerd don't forget |
@JonBendtsen I tried with the edited line :
|
@mdeweerd I also tried :
|
@JonBendtsen @MarcVJ it doesn't exists ! |
i send a fix : #32848 |
This resource suggests that However I did not look in detail and therefore the command should rather ba:
Maybe that does not exist for the flavor (the error was a syntax error without the ' ON '). |
@mdeweerd ok for postgresql and maybe for SQL server, but not for Mysql/MariaDB ! |
NEW setup API can update new extrafields
Third step in fixing #29249 though this pull request can only update.