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 /supplierorders fails with: API not found (failed to include API file) #14279

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

Comments

@dpriskorn
Copy link
Contributor

Bug

Fails both on endpoint and with Restexplorer.

Environment

debug log:

2020-07-22 15:38:42 INFO 127.0.0.1 --- Access to /api/index.php/supplierorders - action=, massaction=
2020-07-22 15:38:42 DEBUG 127.0.0.1 sql=SELECT transkey, transvalue FROM llx_overwrite_trans where lang='en_US' OR lang IS NULL AND entity IN (0, 1) ORDER BY lang DESC
2020-07-22 15:38:42 INFO 127.0.0.1 Load a dedicated API file moduleobject=supplierorders moduledirforclass=fourn
2020-07-22 15:38:42 INFO 127.0.0.1 Search api file /fourn/class/api_supplierorders.class.php => dir_part_file= classname=Supplierorders
2020-07-22 15:38:42 WARNING 127.0.0.1 Failed to make include_once
2020-07-22 15:38:42 INFO 127.0.0.1 --- End access to /api/index.php/supplierorders
2020-07-22 15:41:09 INFO 127.0.0.1 --- Access to /api/index.php/supplierorders - action=, massaction=
2020-07-22 15:41:09 DEBUG 127.0.0.1 sql=SELECT transkey, transvalue FROM llx_overwrite_trans where lang='en_US' OR lang IS NULL AND entity IN (0, 1) ORDER BY lang DESC
2020-07-22 15:41:09 INFO 127.0.0.1 Load a dedicated API file moduleobject=supplierorders moduledirforclass=fourn
2020-07-22 15:41:09 INFO 127.0.0.1 Search api file /fourn/class/api_supplierorders.class.php => dir_part_file= classname=Supplierorders
2020-07-22 15:41:09 WARNING 127.0.0.1 Failed to make include_once
2020-07-22 15:41:09 INFO 127.0.0.1 --- End access to /api/index.php/supplierorders

@dpriskorn dpriskorn added the Bug This is a bug (something does not work as expected) label Jul 22, 2020
@dpriskorn
Copy link
Contributor Author

Just ask if more information is needed. The nginx error log had no related errors.

@ksar-ksar
Copy link
Contributor

Hi,

This error is quiet strange...

https://github.com/Dolibarr/dolibarr/blob/12.0.0/htdocs/api/index.php#L259

So the file to be loaded should be /fourn/class/api_supplier_orders.class.php
But according to your error it load /fourn/class/api_supplierorders.class.php

Have you the good file for /api/index.php ?

@dpriskorn
Copy link
Contributor Author

I debugged a little and think I found the problem. module should be moduleobject. Then it works for me.
The code is unfortunately not that clear IMO with multiple replacements that are not clarified. It should be cleaned up.

@eldy eldy closed this as completed in 391fcc7 Jul 29, 2020
@dpriskorn
Copy link
Contributor Author

Thanks Eldy 👍

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