-
Notifications
You must be signed in to change notification settings - Fork 290
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
Show all individuals gives zero results #4700
Comments
same problem |
I think commits 52288ec & 843973c are introducing the issue (the first one already introduces some conditions when that can happen, and the second one makes it more general). The problem is that it creates a condition tree where it will always add a WHERE condition to the query. webtrees/app/Module/IndividualListModule.php Lines 716 to 721 in 486af7e
In the case when we want to select all individuals, we have the inputs:
In all cases, that will add either I will not dare going further in terms of recommendation to fix, as this is quite a sensitive logic, and I am not sure that what I have in mind will not introduce another issue. Basically, is it as simple as not adding any |
Having looked a bit further at the logic, this is actually a bit more subtle, and my first analysis is incomplete, and had not taken into account the new philosophy of the refactoring. I thought that This is actually earlier in the code that the logic is causing an issue. However, and this is what lead me to believe that webtrees/app/Module/IndividualListModule.php Line 466 in 486af7e
If it OK when a surname has been defined, but when there are none, then webtrees/app/Module/IndividualListModule.php Line 371 in 486af7e
I think that the fix is to flatten the if ($show === 'indi') {
// Build the surname list
// If no reference surname, then flatten the list of surnames calculated earlier
if($surname === '') {
$surnames = [];
array_walk_recursive($surns, function($c, $s) use (&$surnames) { $surnames[] = $s; }); // Is it the best way to flatten ?
}
// Otherwise, use the surnames linked to the reference surname. That is what was done before.
else {
$surnames = array_keys($all_surnames[$surname] ?? []);
}
if ($families) {
echo view('lists/families-table', [
'families' => $this->families($tree, $surname, $surnames, $falpha, $show_marnm === 'yes'),
'tree' => $tree,
]);
} else {
echo view('lists/individuals-table', [
'individuals' => $this->individuals($tree, $surname, $surnames, $falpha, $show_marnm === 'yes', false),
'sosa' => false,
'tree' => $tree,
]);
}
} |
i just try your tip for line 458-471 |
I think that the flattening step still needs some tweaking or an alternative: for a start, I find it ugly 😅, the recursive mode looks wrong to me, and it still seems to add individuals with no surname to the list of individuals whose surname starts by a letter (and I don't think that should happen). I cannot look at it right now, but |
Because i have same problem with webtrees 2.1.16 |
It seems that the query always returns only those individuals which have one name record (regular, _AKA, _MARNM) without a surname surrounded by slashes! |
I've found a workaround to list all individuals in 2.1.17. There is something wrong with the where clause of the database query. In the file app/Module/IndividualListModule.php in the function Individual disable line 709:
If show_all = true, $surnames is empty. So in that case, the where clause narrows the selection while it shouldn't. But what I don't understand is why it does work on the demo site. So this is not a permanent solution, but it works for me and this might work in your case too. |
I think also there is an issue where But thanks for your comments and investigation. As soon as I have a fix for this bug, I'll create a new release. |
See: https://www.webtrees.net/index.php/en/forum/help-for-release-2-1-x/37602-list-of-individuals#96825
When I try to load all individuals, I get zero results. Tested this in webtrees 2.1.14 and 2.1.15. In webtrees 2.1.13 it works as expected.
Multiple users confirm this error.
The text was updated successfully, but these errors were encountered: