Commit 53dd7aa7 authored by Andreas Kusalananda Kähäri's avatar Andreas Kusalananda Kähäri
Browse files

BUGFIX (found by Amonida):

  Fix store() so that the canonical_translation_id in the transcript
  table is updated if the translation gets a new dbID when it is stored.
parent c4088d2e
......@@ -828,7 +828,27 @@ sub store {
}
}
my $old_dbid = $translation->dbID();
$db->get_TranslationAdaptor()->store( $translation, $transc_dbID );
if ( $translation->dbID() != $old_dbid ) {
# The dbID of the translation changed. Need to update the
# canonical_translation_id for this transcript.
my $sth = $self->prepare(
qq(
UPDATE transcript
SET canonical_translation_id = ?
WHERE transcript_id = ?)
);
$sth->bind_param( 1, $translation->dbID(), SQL_INTEGER );
$sth->bind_param( 2, $transc_dbID, SQL_INTEGER );
$sth->execute();
}
# set values of the original translation, we may have copied it
# when we transformed the transcript
$original_translation->dbID( $translation->dbID() );
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment