Bug #9578

Duplicate null note created when translating a note

Added by Justin Simpson about 6 years ago. Updated about 6 years ago.

Status:VerifiedStart date:03/16/2016
Priority:MediumDue date:
Assignee:Dan Gillean% Done:

0%

Category:I18N
Target version:Release 2.3.0
Google Code Legacy ID: Tested version:2.2
Sponsored:No Requires documentation:

Description

In some reported cases, when adding a note to a RAD description, and then providing a translation to that note, a duplicate row appears in the user interface. The duplicate has no content.

Looking in the note_i18n table, when this happens, the translated version of the note has 2 rows, whereas the original version of the note has just one row:


+---------------------------------------------------------------------+------+---------+
| content                                                             | id   | culture |
+---------------------------------------------------------------------+------+---------+
| Title based on the provenance of the fonds.                         |  437 | en      |
| NULL                                                                | 1781 | en      |
| Titre basé sur la provenance du fonds.                              | 1781 | fr      |
+---------------------------------------------------------------------+------+---------+


I was not able to reproduce this on demo.accesstomemory.org.

History

#1 Updated by Justin Simpson about 6 years ago

  • Description updated (diff)

#3 Updated by Dan Gillean about 6 years ago

  • Category set to I18N

#4 Updated by Nick Wilkinson about 6 years ago

  • Assignee changed from Nick Wilkinson to José Raddaoui Marín

Hi Radda, assigning to you to investigate along with the client ticket #9579.

#5 Updated by José Raddaoui Marín about 6 years ago

  • Subject changed from Duplicate null note created when translating a note? to Duplicate null note created when translating a note

I have been able to reproduce both issues now, the translation problem and the notes without source culture. The cause of both issues is this line:

https://github.com/artefactual/atom/blob/qa/2.3.x/apps/qubit/modules/informationobject/actions/notesComponent.class.php#L216

Where we're forcing the note source culture to be the same as the information object source culture. This creates notes without source culture if they are added at the same time the IO is created. And creates notes with a source culture different than the culture with the value added, when they are created in a culture different than the one from the IO. Those notes are not editable as we remove them from the other cultures forms in here:

https://github.com/artefactual/atom/blob/qa/2.3.x/apps/qubit/modules/informationobject/actions/notesComponent.class.php#L147

I don't know if there is a real reason to force the same source culture, as we use culture fallback in the GUI and most (if not all) of the exports. But after removing that line both issues are fixed.

#6 Updated by José Raddaoui Marín about 6 years ago

  • Status changed from New to Code Review
  • Assignee changed from José Raddaoui Marín to Nick Wilkinson

#7 Updated by Jesús García Crespo about 6 years ago

  • Status changed from Code Review to Feedback
  • Assignee changed from Nick Wilkinson to José Raddaoui Marín

LGTM! One observation - highly unrelated! - the body of the commit message does not have to be wrapped at 50 characters. That's only true for the first line. The body should be wrapped at 72 characters or so. I personally use 80.

#8 Updated by José Raddaoui Marín about 6 years ago

  • Status changed from Feedback to QA/Review
  • Assignee changed from José Raddaoui Marín to Dan Gillean

Merged in qa/2.3.x

#9 Updated by Dan Gillean about 6 years ago

  • Status changed from QA/Review to Verified

#10 Updated by Dan Gillean about 6 years ago

  • Target version set to Release 2.3.0

Also available in: Atom PDF