-
-
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
Reintroduce Conf/DeprecationHandler #29221
base: develop
Are you sure you want to change the base?
Reintroduce Conf/DeprecationHandler #29221
Conversation
85eb047
to
74080c1
Compare
Got several issues:
It seems conf class is too critical for the moment to use doldeprecatedhandler. |
This seems strange as $conf->facture should access $conf->invoice and hence have the directory defined. The idea of the handler is not have any prerequisite on code changes. I guess that a test case should be able to show the issue so that the real reason can be discovered - maybe something in the deprecationhander, maybe something else. |
@mdeweerd warning for " ->multidir_output" !! this is for multicompany ! and multicompany it's me ! i'm nervous break down !! ;-) |
These two items are fixed. The issue was with the initialisation of the dir_output which was using the new name. I created a test case that currently verifies that the directory is the same for the old and the new module name. The develop branch currently fails this test, with the deprecation handler enables on conf it does not! @hregis The multicompany is not subject to deprecation and should not be handled differently. I do not know if the next 3 mentionned items still fail with this change. A test case would be useful there too. A mapping of "newmodulename => rootpath" would be useful both for testing and the initialisations in conf. |
8ae37eb
to
cf692cf
Compare
@eldy I guest that the item "some menus also disappeared, for exemple the menu of purchase orders." is not an issue when I have the following in the Vendor tab: If yes, that was also an effect of the module initialisation. |
cf692cf
to
c4d03f5
Compare
I remember that i fixed this point by adding the code after the line // Duplicate entry with the new name into conf.class.php |
Good, then that is fixed by the change in the module initialisation as weel (in this PR). Now I am trying to understand the following statement:
|
c4d03f5
to
221dd5a
Compare
I found that the ecm module is used for the document management and I was able to reproduce the issue interactively. The reason for the issue that was still present after the change in the initialisation was that the Conf class was referencing the old module names itself thereby accessing the private properties directly without triggering the deprecationhandler. So that is fixed by removing the private fields for the old names. I tested this locally. So IMHO the reported issues are fixed and the method can be reinstated. This means that to avoid side effects, private 'old' names can not be used. |
Extra note: I think it would be a good idea to define the expected subdirectory in the module and use that information in the Conf class rather than having the information in the Conf class itself. Maybe implement a getter function that would have a default implementation in DolibarrModules that returns the name of the module. A module can then override this getter as needed to return another path. |
8f10258
to
cb9c57f
Compare
cb9c57f
to
ef44dba
Compare
ef44dba
to
dbb8c7d
Compare
@eldy
What is the issue?
IMHO, a test case should demonstrate the issue so that the real cause can be determined.
From reading the code I can only see the following as a possible cause, and an overlooked deprecation mapping (I could not find any):
dolibarr/htdocs/core/class/conf.class.php
Lines 570 to 572 in 56f9ec4
Possibly $mapping should be restricted to MODULE_MAPPING and not the entire deprecation list.