fisharebest / webtrees

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

2.0.12 - Collapsing and unfolding citation details #4654

Closed TheDutchJewel closed 1 year ago

TheDutchJewel commented 1 year ago

When collapsing and unfolding citation details from, say, BIRT, this also works into the events CHR/CREM/BURI.

But not for DEAT, which works separately.

Tested by adding an unlinked individual on the live demo.

Is that intentional, or is it a bug?

fisharebest commented 1 year ago

Not sure what you are seeing. Expand/collapse of DEAT:SOUR is working for me.

Screenshot 2022-12-13 at 13 46 44 Screenshot 2022-12-13 at 13 46 53
ungeahnt commented 1 year ago

When collapsing and unfolding citation details from, say, BIRT, this also works into the events CHR/CREM/BURI. But not for DEAT, which works separately.

This effect occurs also with CHR/CREM/BURI.

You have to enter text in the TEXT or NOTE field and when you save, afterwards the folding functionality is gone.

TheDutchJewel commented 1 year ago

Expand/collapse of DEAT:SOUR is working for me.

For me too, that's not the problem.

When collapsing and unfolding citation details from, say, BIRT, this also works into the events CHR/CREM/BURI.

But not for DEAT, which works separately.

The question is why when collapsing and unfolding citation data from BIRT, for example, the source data also collapses and unfolds events CHR/CREM/BURI, but not on DEAT (which works separately).

ric2016 commented 1 year ago

As noted in the original ticket, this is caused by multiple elements in the DOM with the same id attribute (e.g. 'collapse-15'), which should generally be avoided.

ungeahnt commented 1 year ago

Sorry, I misunderstood

TheDutchJewel commented 1 year ago

Not sure what you are seeing. Expand/collapse of DEAT:SOUR is working for me.

_Originally posted by @fisharebest

@fisharebest fisharebest added the cannot reproduce

How to reproduce

  1. Add unlinked individual on on live demo.

  2. Unfold source citation from BIRT.

Before unfolding source citation from BIRT: afbeelding

After unfolding source citation from BIRT: afbeelding

ric2016 commented 1 year ago

Is this still unclear? (because it still has the 'cannot reproduce' label) As noted above, the cause are multiple elements with the same id attribute in the DOM.

fisharebest commented 1 year ago

Is this still unclear?

Yes.

I add a new individual.

I open the panels for birth and death.

Both panels have a (collapsed) source-citation.

I click to expand BIRT:SOUR. It expands. I click to expand DEAT:SOUR. It expands. I click to collapse BIRT:SOUR. It collapses. I click to collapse DEAT:SOUR. It collapses.

fisharebest commented 1 year ago

As noted above, the cause are multiple elements with the same id attribute in the DOM.

I don't see any duplicates.

All the IDs (#collapse-XXX) are unique.

ric2016 commented 1 year ago

To summarize this comment:

Create a new individual on the demo server. https://dev.webtrees.net/demo-stable/index.php?route=%2Fdemo-stable%2Ftree%2Fdemo%2Fadd-child-to-individual%2Fi1&sex=U

click to expand BIRT:SOUR. (one of its elements has "collapse-15") -> BURI:SOUR expands also - this is the effect this is about. (it probably also expands because one of its elements has the same "collapse-15")

fisharebest commented 1 year ago

Thanks. It depends on which subtags are enabled.

I guess that I was "lucky", and the collapse elements in each fact/event had different positions in my data...

We are using $key. We should probably be using $id[$key] .