Bug 82905 - EDITING: Foreign Key between two subforms do not work anymore
Summary: EDITING: Foreign Key between two subforms do not work anymore
Status: RESOLVED DUPLICATE of bug 82151
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
4.3.0.4 release
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-08-21 11:35 UTC by Knut Esztermann
Modified: 2014-08-24 18:47 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Knut Esztermann 2014-08-21 11:35:44 UTC
Problem description: 
I have a form with two subforms (a table for 'file', only showing entries with 'file'.'movie_id" matching 'movie'.'id' and a table 'audiotrack' only showing entries with 'audiotrack'.'file_id' matching the currently selected 'file'.'id'). The backend is mysql.

This happened to work before. After the update to 4.3.0, the 'file'.'id' as a foreign key in the 'audiotrack' subform seems to not be updated on changing main records.

Two related problems:

1) The records of the second table ('audiotrack') are never updated, they only show records belongig to the first shown 'file' entry. When a record has no 'file' entry, they disappear; after selecting another record with existing 'file' entries, the same wrong records appear again.

2) It is not possible to add records, the insertion fails with:
SQL Status: 23000
Error code: 1452

Cannot add or update a child row: a foreign key constraint fails ("movies"."subtitletrack", CONSTRAINT "subtitletrack_ibfk_1" FOREIGN KEY ("file_id") REFERENCES "file" ("id") ON DELETE CASCADE ON UPDATE CASCADE)



Steps to reproduce:
1. Change to another record
2. Enter a new record in the 'subtitletrack' form

Current behavior:
1. The records in 'subtitletrack' do not change
2. It is not possible to save the newly created record

Expected behavior:
1. The records in 'subtitletrack' should change according to the selected 'file' record
2. New records should be saved with the correct foreign key
Comment 1 Robert Großkopf 2014-08-21 19:28:56 UTC
Could this be a duplicate from Bug82720 ? Refreshing from a subsubform doesn't work any more since 4.3.0.0 alpha.

Or are your subforms installed parallel, both connecting to the mainform?
Comment 2 Knut Esztermann 2014-08-21 21:22:35 UTC
Hi,

> --- Comment #1 from robert@familiegrosskopf.de ---
> Could this be a duplicate from Bug82720 ? Refreshing from a
> subsubform doesn't
> work any more since 4.3.0.0 alpha.

this could indeed be the same problem. I looked into the example
db and the behaviour is exactly the same, I just did not
understand the relationships completely, as it says
'SubTable'.'MainID' for both, 'Link master field' and 'Link slave
field' on the subsubform.

> Or are your subforms installed parallel, both connecting to the
> mainform?

No, not in parallel, the first sub form is connected to the main
from, the second one is connected to the first sub form.


/ Knut Esztermann
Comment 3 Robert Großkopf 2014-08-24 18:47:17 UTC
It's a duplicate of Bug82151, which has been fixed for LO 4.3.2.

*** This bug has been marked as a duplicate of bug 82151 ***