fisharebest / webtrees

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

List module routes not always handled properly #3171

Closed ric2016 closed 4 years ago

ric2016 commented 4 years ago

For private trees, the list urls result in errors when the user is logged out, e.g. when using /webtrees/module/source_list/List/tree1:

#0 [internal function]: Fisharebest\Webtrees\Webtrees::Fisharebest\Webtrees\{closure}(2, 'assert(): asser...', 'C:\\xampp7\\htdoc...', 84, Array)
#1 …\app\Module\SourceListModule.php(84): assert(false, 'assert($tree in...')
#2 …\app\Http\RequestHandlers\ModuleAction.php(90): Fisharebest\Webtrees\Module\SourceListModule->getListAction(Object(Nyholm\Psr7\ServerRequest))

In general, Router.php handles these cases, but only when the tree parameter is explicitly mandatory, which isn't the case for module routes.

Therefore, the respective check and redirect has to be made either by the module itself, or we'll have to define special module routes with mandatory tree parameters (we had discussed this a while ago in a different context here), which would solve this as a side effect.

fisharebest commented 4 years ago

This was fixed (yesterday) by #3169

fisharebest commented 4 years ago

Correction - a similar problem was fixed in #3169.