Symptom: The setup halts at 40% with the message:
Wrong filename in configuration file: file = , module = business, filename = /opt/dev/trunk//env-production/itop-profiles-itil/model.itop-profiles-itil.php
Reason: a module (with no dependency) contains the following piece of XML:
<?xml version="1.0" encoding="UTF-8"?> <itop_design xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.0"> <user_rights> <profiles> </profiles> </user_rights> ... </itop_design>
Root cause:
It seems that the "profiles" part gets compiled in the PHP "model" file of the first module encountered (in the installation order) which contains a "profiles" tag. If such a module comes before "itop-profiles-itil" then the result of the compilation of "itop-profiles-itil" is empty an no model files gets generated for the module. Which causes the above mentioned failure.
Work around:
- Do not put the empty <user_rights><profiles> tags in your XML if you don't need them.
It seems to be the <user_rights> tag which causes the trouble, even without a <profiles> tag underneath.
Last edit: Denis 2014-08-05
1) Improved the error message, which becomes:
Include: wrong file name in configuration file (in memory): section = business, filename = C:\inetpub\wwwroot\trunk//env-production/itop-profiles-itil/model.itop-profiles-itil.php
2) Fix
The compiler pushes the compiled code for user rights into the first module that declared the node "user_rights". The symptom is due to the fact that the file model.itop-profiles-itil is declared in the corresponding module file, but the compiler did put the code in another file. Moreover, it is not garanteed that this file will be included, resulting in an error at run time.
I have improved the current algorithm that determines were to put the compiled user rights.
If the module itop-profiles-itil is present, then it will be the target.
Otherwise the former algorithm is still in place.
Committed in trunk as [r3374]
That said, the bullet proof algorithm would be to push the compiled user rights into a dedicated directory, the same way as for the dictionaries. But that change would require developers to update their profile modules to remove the model.xxx include specification from the module file.
Related
Commit: <Commit _id='5358055aa02bb175d1406271:3374' tree_id='6f322e50fded2a2c718b50c16933a545a0d4685d' committed=I{'date': datetime.datetime(2014, 10, 22, 15, 31, 53, 940000), 'email': '', 'name': 'romainq'} authored=I{'date': datetime.datetime(2014, 10, 22, 15, 31, 53, 940000), 'email': '', 'name': 'romainq'} message='#972 Incomprehensible error message during setup, with a sample extension provided by Combodo! (empty user rights tag) -This fix improves a lot, but the final fix should be to compile user rights in a separate directory. To be further discussed.' parent_ids=I['5358055aa02bb175d1406271:3373'] child_ids=I['5358055aa02bb175d1406271:3375'] repo_ids=I[ObjectId('5358055aa02bb175d1406271')]>
Last edit: Romain Quetiez 2014-10-22
The actual cause of the error is that the compiler does not produce the file "model.xxx.php" at all for the empty module. What about producing the file even if it does not contain any PHP declaration?
This fix would cope with the issue that is currently visible. Then, we would have a model.xxxx file in which the user rights are compiled... and it is uncertain that this file will be included (included files must be explicitely listed in the module files)