Searching sources from Wrong tree

Bug #1382722 reported by rmotters
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
webtrees
Fix Released
Medium
fisharebest

Bug Description

I was entering a new event, and instead of typing part of a source name, and selecting from the list, I used the "Find Sources" button.

When looking through the filtered results, I noticed that they were from a different tree.

I have included a screenshot, which show me working on "Test Tree" and the sources which come from "My Family Tree".

I am using Version 1.6.0.

Revision history for this message
rmotters (rmotters) wrote :
Revision history for this message
fisharebest (fisharebest) wrote :

I can't reproduce this.

Your screenshot doesn't show the full URL of each window (i.e. the "ged=XXX" parameter).

I see all windows with the correct "ged=xxx" parameter and search results from the expected tree.

Do you have any other information that might help me reproduce this?

Changed in webtrees:
status: New → Incomplete
Revision history for this message
rmotters (rmotters) wrote :

Hi,

It only occurs in one of 3 of my trees. The tree is "Leek Mottersheads".

Although, I have also been able to reproduce it when using "Link this individual to an existing family as a child".

I have included new screenshots, they are:

1) List of trees.
2) List of sources from "Leek Mottersheads"
3) Ready to search for the term "Wales" in the sources.
4) Then the find results showing the sources from the other tree.

The find results screen does not show the "ged=" on the URL, but you can plainly see by the source that the results came from "My Family Tree", by looking through the page source.

I have also set a limited test user, if you want access, to have a look.

Revision history for this message
rmotters (rmotters) wrote :

I have been some extra testing and I have another screen shot. This is of the HTML Source before I click find.

As you can see in the URL the gedcom name is "Test Tree", but the GEDCOM in the HTML Source is "My Family Tree".

I am going to investigate this a bit further, tomorrow.

Revision history for this message
rmotters (rmotters) wrote :

OK, I think I have found the problem.

The problem is occurring because I have a space in my GEDCOM names. This is causing the edit_interface.php script to pass the ged value, as a string that includes a "%20", rather then the name of the GEDCOM with the space:

Example:
---------
 <td class="facts_value">
      <input data-autocomplete-type="FAM" type="text" id="famid" name="famid" size="8">
      <a href="#" onclick="findFamily(document.getElementById('famid'), 'Test%20Tree'); return false;" class="icon-button_family" title="Find a family"></a> </td>
------------

This was causing the routine that sets WT_TREE, in includes/session.php, to not find a match, which inturns passing back the value of the last gedcom (My Family Tree).

I deducted it was down to the functions in includes/functions/functions_print.php. These functions were displaying WT_GEDURL, not WT_GEDCOM. The functions I had identified were:

 - print_findplace_link()
 - print_findfamily_link()
 - print_findrepository_link()
 - print_findmedia_link()
 - print_findfact_link()

Making these changes, fixed the issue.

Revision history for this message
fisharebest (fisharebest) wrote :

Well spotted. It's the wrong escaping - but the correct variable (WT_GEDCOM) is already available to javascript, so we just need to use that, rather than pass in an escaped value..

Changed in webtrees:
status: Incomplete → Fix Committed
importance: Undecided → Medium
assignee: nobody → fisharebest (fisharebest)
Revision history for this message
fisharebest (fisharebest) wrote :

Fix released in 1.6.1.

Changed in webtrees:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.