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

error on api_proposals.class.php #25929

Closed
fernandomacho opened this issue Sep 15, 2023 · 1 comment
Closed

error on api_proposals.class.php #25929

fernandomacho opened this issue Sep 15, 2023 · 1 comment
Assignees
Labels
Bug This is a bug (something does not work as expected)

Comments

@fernandomacho
Copy link

Bug

if call to endpoint
/api/index.php/proposals/xxxxx/lines without sql filter
this generate an exception
The line 319 of file htdocs/comm/propal/class/api_proposals.class.php
say:
$this->propal->getLinesArray($sql);
and $sql is not set
this line would set into if at line 311
if (!empty($sqlfilters)) {

Environment Version

18.0.1

Environment OS

Ubuntu 22.04

Environment Web server

Nginx

Environment PHP

8.2

Environment Database

mariadb 10

Environment URL(s)

No response

Expected and actual behavior

2023/09/15 13:02:57 [error] 704889#704889: *47475930 FastCGI sent in stderr: "PHP message: PHP Warning: Undefined variable $sql in /xxxxx/htdocs/comm/propal/class/api_proposals.class.php on line 319" while reading response header from upstream, client: xxx.xxx.xxx.xx, server: xxxxxxxt, request: "GET /api/index.php/proposals/nnnnn/lines HTTP/1.1", upstream: "fastcgi://unix:/run/php/php8.2-fpm.sock:", host: "xxxxxxx"

Steps to reproduce the behavior

curl -X GET --header 'Accept: application/json' --header 'DOLAPIKEY: xxxxxx' 'https://xxxxxxx/api/index.php/proposals/nnnnnn/lines'

Attached files

No response

@fernandomacho fernandomacho added the Bug This is a bug (something does not work as expected) label Sep 15, 2023
atm-maxime added a commit to atm-maxime/dolibarr that referenced this issue Sep 16, 2023
@atm-maxime atm-maxime self-assigned this Sep 16, 2023
@atm-maxime
Copy link
Member

Fix pending approval

@eldy eldy closed this as completed in bb0c539 Sep 16, 2023
eldy added a commit that referenced this issue Sep 16, 2023
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