Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added note about identifier uniqueness for collection fields #327

Closed
wants to merge 1 commit into from

Conversation

derhansen
Copy link
Member

It is important to note, that it should be avoided to have multiple content blocks, which all have a field of the type collection and which all share the same table and which all have the same identifier.

If different content blocks use the same identifier for collection fields that use the same foreign_table (e.g. tt_content), it occurs, that collection children get mixed up.

It is important to note, that it should be avoided to have multiple content blocks, which all have a field of the type `collection` and which all share the same table and which all have the same identifier.

If different content blocks use the same identifier for collection fields that use the same `foreign_table` (e.g. `tt_content`), it occurs, that collection children get mixed up.
@nhovratov
Copy link
Contributor

nhovratov commented Dec 23, 2024

Hm, I don't get it 100% yet.

So even if you have the same identifier across multiple Content Blocks (for tt_content) and prefixing disabled (which will result in duplicate definition of the field), you will never have mixed up childrens because the record is unique. This can only happen, if you have two fields inside one record, which point to the same foreign table. So could you give a concrete example, where this problem happened for you?

My guess is, you either used Record Types / Pages Types or Collections within Collections. But then you need to define shareAcrossTables so that the tablename of the parent is stored anlongside with the foreign key.

@derhansen
Copy link
Member Author

I used Collections within Collections. I first forgot to add shareAcrossTables, but added it later on and the problem with mixed content persited. Anyway, I tried to create an new example, but can not reproduce the problem any more... I will therefore close this PR now, as it is invalid.

Thanks for your quick answer and thanks a lot for all your work on Content Blocks 👍

@derhansen derhansen closed this Dec 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants