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

Fix loading api files for external modules #9124

Closed
wants to merge 1 commit into from

Conversation

kadogo
Copy link
Contributor

@kadogo kadogo commented Jul 19, 2018

Fix #9116 Fix load api for external modules

Actually the API from external modules are not loaded automaticaly
This PR try to find the right path for a module if it's find in the custom directory

@eldy
Copy link
Member

eldy commented Jul 24, 2018

This feature should be implemented into 7.0 or 8.0
Did you check with a such version ?

@eldy eldy added the PR no new feature into freezed/released branch PR can't be accepted because it's feature change or optim pushed into a stable branch already frozen label Jul 24, 2018
@bilbo-the-hobbit
Copy link

hello @eldy,

this fix is for our dolibarr version 7.0.3 and is need for the api to work. we have some integration between gitlab and dolibarr and without this patch the call to the dolibarr API doesnt get trough.

Cheers

@eldy
Copy link
Member

eldy commented Jul 24, 2018

PR was pushed into 6.0 branch. Same with 7.0, no implementation of new features are allowed in an already released version.

Note that if using dolibarr 7.0.3, if your module is called "abc" then having the api file
api_abc.class.php should already be supported with standard code :
getModuleDirForApiClass will return $moduledirforclass = abc
And into the api/index.php file, the code
dol_buildpath('/'.$moduledirforclass.'/class/');
shoudl works when your module is inside custom/abc

With no need of this patch.

@kadogo
Copy link
Contributor Author

kadogo commented Jul 24, 2018

Hello @eldy

It is true when the API file have the same name of the module.

Most of time the API file is set in plural (example timebaskets, interventions).

You can see it clearly #9116 where he searchs "timebaskets".
My patch show the probem because I need to force the path to timebasket.

Cheers.

@frederic34
Copy link
Contributor

@kadogo did you try to name your api class file api_timebasket.class.php and in this file to declare class TimebasketApi extends DolibarrApi

@kadogo
Copy link
Contributor Author

kadogo commented Aug 27, 2018

@frederic34
I showed the issue to the author he better know what to do about the modules.
The issue here is that timebasket have 2 different API class.
Eldy said that only 1 API file is authorized so I wait to know what will do the author.

@eldy eldy closed this Sep 7, 2019
@eldy
Copy link
Member

eldy commented Sep 7, 2019

This bug or the feature request seems to be fixed or included into last recent stable version, so I close the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR no new feature into freezed/released branch PR can't be accepted because it's feature change or optim pushed into a stable branch already frozen
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants