Bug #21102
closedIRRE: Selected items not removed from selector when foreign_unique is set
100%
Description
Hi there,
Selected Items are not removed from inline record selector (unique) and child record selectors.
there is a bug in t3lib/jsfunc.inline.js setUnique function. The attached patch should fix the problem.
Install attached extension (key: bug_15400).
On some page:
- insert a few "Bug 15400 record of type 2";
- insert a "Bug 15400 record of type 1" and create some relations: the used records should be removed from the selector of the parent record and from the selectors of the children records.
The same behaviour should happen when updating "Bug 15400 record of type 1":
- on expanding a child, the selector should not contain records already used in other children.
(issue imported from #M15400)
Files
Updated by Martin Borer over 14 years ago
Uploaded patch...
SNV patch request (core list):
http://lists.typo3.org/pipermail/typo3-team-core/2010-August/041940.html
Updated by Martin Borer over 14 years ago
patch was missing, sorry.
Uploaded patch irre_15400_rev8536.patch
Updated by Martin Borer about 14 years ago
Here is a better description for this problem:
If you use a IRRE Selector (see attached image). The entries in the
selectors are not removed (main Child record selector, and selectors in
child records) if you click on a item to add it.
Example of inline TCA field:
"matrix" => Array (
"label" =>
"LLL:EXT:adia_prodmng/locallang_db.xml:tx_adiaprodmng_products.matrix",
"config" => Array (
"type" => "inline",
"foreign_table" => "tx_adiaprodmng_matrix_rel",
"foreign_field" => "prod_id",
"foreign_selector" => "usage_id",
"foreign_sortby" => "sorting",
"foreign_label" => "usage_id",
'foreign_unique' => 'usage_id',
'appearance' => Array(
//"useCombination" => 1,
'showSynchronizationLink' => 1,
'showAllLocalizationLink' => 1,
'showPossibleLocalizationRecords' => 1,
'showRemovedLocalizationRecords' => 1,
"useSortable" => 1,
),
'behaviour' => array(
'localizationMode' => 'select',
),
"maxitems" => 50,
"size" => 15,
)
),
The setUnique function was not updated for the new handling with the
scriptaculous javascript framework.
Updated by Philipp Kerling about 14 years ago
I can confirm that the patch works as expected.
Updated by Stanislas Rolland almost 14 years ago
Uploading new patchwes for this issue.
There were problems with the submitted patch. In particular when updating a parent record and its relations, and when collapseAll is set, on expanding an existing child, the selector in the child would not exclude records used in other children.
Updated by Martin Borer over 13 years ago
some progress here?
Is the patch ready for the next Typo3 4.5.x release?
Would be great if this could be fixed in the next release, we have to use an old patched 4.4 release for our projects now...
Updated by Gerrit Code Review almost 13 years ago
- Status changed from Accepted to Under Review
Patch set 1 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/8892
Updated by Stanislas Rolland almost 13 years ago
Gerrit Code Review wrote:
Patch set 1 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/8892
Please test this change.
Problem:
When an inline field is defined as unique (foreign_unique is set), selected items are removed neither from the inline record selector, nor from the children record selectors.
Solution:
Remove the used records from all selectors. Also, when updating and collapseAll is set, remove records already used from the child record after its ajax-retrieval/expansion.
How to reproduce and test:
1. Install attached extension (key: bug_15400).
2. On some page:
- insert a few "Bug 15400 Record of type 2";
- insert a "Bug 15400 Record of type 1" and create some relations:
the used records should be removed from the selector of the
parent record and from the selectors of the children records.
3. The same behaviour should happen when updating "Bug 15400 Record of
type 1":
- on expanding a child, the selector should not contain records
already used in other children.
Updated by Gerrit Code Review almost 13 years ago
Patch set 1 for branch TYPO3_4-6 has been pushed to the review server.
It is available at http://review.typo3.org/8955
Updated by Gerrit Code Review almost 13 years ago
Patch set 1 for branch TYPO3_4-5 has been pushed to the review server.
It is available at http://review.typo3.org/8956
Updated by Stanislas Rolland almost 13 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 908b2a7f9f9359aaa1063dacf38736269440e73c.