fisharebest / webtrees

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

Different charts in a multitree site on my page not possible. #4153

Open JustCarmen opened 2 years ago

JustCarmen commented 2 years ago

Tested on the demo site (current release, can't find the charts block in latest beta which is a mistake I hope!)

When activating the blocks on my page everything goes well. The pedigree with the default person of both trees is set on each my-page. But when changing the chart in one my-page, the data of the other is completely removed and the text 'You must select an individual and a chart type in the block preferences' appears.

As soon as you set the chart on the other my page, then the first one is removed. So it is not possible to set two charts with two different starting persons on two my-pages in a multitree site.

JustCarmen commented 2 years ago

I notice something similar with other blocks. I think this is caused by the fact that the tree id is not stored in the database when it comes to my-page blocks. Blocks on the tree page are stored along with the tree id.

fisharebest commented 2 years ago

See #4051

Blocks on the tree page are stored along with the tree id.

If we store a tree-id, then the block will appear on the tree's home page - not the user's my-page.

JustCarmen commented 2 years ago

I see. I thought this was a bug, but this is by design.

But here is the situation. I have granted someone access to two different trees. In both trees the person is a close relative of the individual from whom the ancestors are in that particular tree. I want to give them the pedigree of those two individuals on each my-page to start with to get a quick overview of the pedigree and to to navigate through the website with ease. In both cases this is not the member himself and also not the default person as set in the control panel because these individuals are alive and thus private.

See also my comment at #4051.

ddrury commented 2 years ago

Logically this is simple to implement although I think a fair bit of code would need altering and I'm not sure if the migration would be straightforward.

On the tree page we always display the same blocks irrespective of the login status so to get the blocks select

->where('tree_id', '=', $tree_id)
->whereNull('user_id')

For my-page select

->where('tree_id', '=', $tree_id)
->where('user_id', '=', $user_id )

and of course updating the pages would need similar queries.

fisharebest commented 2 years ago

This would give you a different "My page" for every tree on the site. Potentially with different blocks in each.

Wouldn't that just be too confusing?

ddrury commented 2 years ago

Possibly, but I thought this was what @JustCarmen was after

JustCarmen commented 2 years ago

Possibly, but I thought this was what @JustCarmen was after

Yes, it does. You should be able to set up your own "my page" in each tree to facilitate navigation and research in that particular tree. That means you should be able to select a different viewpoint in each user page.

I have added a member as an editor to the family tree that he himself is a part of. To help him navigate the website, I set up a family tree diagram on the user page, starting with himself. He has the right to edit within a path of 2, so this helps him find his closest relatives and it gives him a quick overview of the rest of his family tree.

But this editor also has visitor or membership rights in other trees. And because he is a registered user, he also has a userpage in those trees. When he uses the chart block there, he should have a different viewpoint because this registered user is not part of that tree. But as soon as I set the chart to start with the default root person of that tree, the chart disappears in the first tree (the one I give him editor rights in) and a message appears, "You must select a person and a chart type in the block preferences." It only works if I use the same individual for both charts. But a person in one tree does not automatically exists in the other. So you end up in a vicious circle. Because if I select someone else again in the first tree, the message appears in the second tree, so you can never set it right.

ddrury commented 2 years ago

This would give you a different "My page" for every tree on the site

But of course if a "My page" hadn't been customised, the default blocks would be displayed so not necessarily true that all "My pages" would be different

reteP-riS commented 2 years ago

I am running 3 trees in my webtrees v2.0.19. As admin I have full access to all trees. There are no privacy restrictions in place. I added the pedigree chart to the My Page.

When selecting an individual for tree 3 - which I imported from another application with very long XREFS like I1923653207548 - the charts for tree 1 and tree 2 say "You must select an individual and a chart type in the block preferences."

So currently only one chart type and one individual XREF can be used. I believe JustCarmen's request can be fulfilled by storing the individual XREF with the tree ID for this chart. That sounds like a simple enhancement and doesn't seem to require to manage completely different My Pages per user with different blocks all over the place.

EDIT: Will adding a tree ID automatically cause the block to appear on the tree's home page - not the user's my-page?

fisharebest commented 2 years ago

EDIT: Will adding a tree ID automatically cause the block to appear on the tree's home page - not the user's my-page?

Correct.

The columns wt_block.gedcom_id and wt_block.user_id are only used to identify the type of block (i.e. which module), and block_id (which instance of that module).

If there is a gedcom_id, then it is a tree block. If there is a user_id, then it is a user block

We then ask the module to displaly itself, using settings linked to its block_id.

Obviously, we could redesign all this. But I think it gets confusing. Other home-page blocks use the same configuration for every tree.

e.g. number of top surnames, which media to include in the slide show, how many days to show in upcoming events, etc.

This block would then be different, as it would have different configuration depending on which tree it was displaying.

Then, if we add per-tree configuration to this setting (XREF for the chart), perhaps we need per-tree configuration for every setting in every block.

I think many users find the home-page / my-page system confusing enough as it is.

SnarfW commented 2 years ago

As mentioned in #4350 I am missing the possibility to add the chart block om my page. From the above I understand that it can be made available again. Since it was available in previous versions, including v2.0 I am hoping that it can be made available again.

I think many users find the home-page / my-page system confusing enough as it is

Maybe for some, but not for all users... I generally create the my-page for other users. In addition I expect that most (guest) users will only have access to one tree

fisharebest commented 2 years ago

It was available in earlier versions, but it did not work.

Blocks have the same settings for all trees. This includes the XREF parameter for the tree.

So, the block uses the same XREF from every tree.

Hence it works if you only have one tree. It fails if you have two or more trees.

arbor95 commented 2 years ago

Since I have only one tree (many usages have only one) the discussed problem is not relevant for me. The block worked well in the earlier versions in this (my) case and I and others would like to see that again. For those, who have more than one tree, a hint or a removed possibility will be enough and ok.