fisharebest / webtrees

Online genealogy
https://webtrees.net
GNU General Public License v3.0
418 stars 290 forks source link

Error in the order that custom module functions are called #4953

Closed sevtor closed 4 months ago

sevtor commented 4 months ago

When adding new custom modules the module structure includes a file module.php which can contain different functions. For report modules it is important to include translation files for supported languages. The translations are included by the definition of a function customTranslations($lang) which shall return an array of translations.

However, these translations are activated when the report is generated (good, expected) but not when the report was selected. The effect can be seen in the included image Rapporter-orig.png. My proposed solution is to add translations from custom modules already in the file app/Module/ModuleCustomTrait.php as can be seen in the included patch file. After this change clicking on the Reports menu item will yield a menu with translated options.

(This patch is also included in PR#4945) #Error in the order that custom module functions are called

sevtor commented 4 months ago

Screenshots showing the effect: Reports.pdf

patch file: ModuleCustomTrait.txt

sevtor commented 4 months ago

I am really sorry, this effect was due to my test environment where I used symbolic links to simplify my tests. When I copied the files instead of using links this works as it should.

I will test without links before I create any more issues!