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

Field palette configuration is duplicated across content elements with the same field #601

Closed
schloram opened this issue Oct 20, 2023 · 4 comments

Comments

@schloram
Copy link
Contributor

Hi,
I'm not sure if this intentional, a sideffect which can't be bypassed or a bug. Maybe you can help me out here. :)

First: I have the json-split option enabled.

Szenario:
I have a bunch of mask content elements which are all using the same tx_mask_link field. I'm now adding a new content element (or editing an existing one) called faq_teaser which uses the same field but now I want to wrap the field in a palette. Then the following additional config is added in this new content element for the tx_mask_link field:

  "description": {
    "faq_teaser": ""
  },
  "inPalette": 1,
  "inlineParent": {
    "faq_teaser": "tx_mask_4d2d427792e96"
  },
  "label": {
    "faq_teaser": "LLL:EXT:my_ext\/Resources\/Private\/Language\/locallang_tca.xlf:field.link"
  },
  "order": {
    "faq_teaser": 1
  }

Now when I edit one of the older content elements which had the tx_mask_link as well and save, the exact same above config is added to every content element even though in these content elements the field is not wrapped in a palette.

This means I have information about the "faq_teaser" CE in every other content element. And restructuring one content element with palettes might lead to changed configs in every other content element. Also this makes version control reviews and diffs harder to understand.

I thought with the json-split option every config is considered self-sufficient.

This behavior is also reproducible with the override_shared_fields option enabled.

Is my understanding incorrect and this is intentional and necessary or did I face a bug here?

TYPO3: v12.4.7
Mask: v8.3.6

@schloram schloram changed the title Palette configurations is duplicated across content elements Field palette configuration is duplicated across content elements Oct 20, 2023
@schloram schloram changed the title Field palette configuration is duplicated across content elements Field palette configuration is duplicated across content elements with the same field Oct 20, 2023
@nhovratov
Copy link
Collaborator

Hi, this is a known behaviour. This does not cause any harm, so I had no priority to fix this. I know this is not ideal in git diff views. I will have a look if this can be fixed easily.

nhovratov added a commit that referenced this issue Oct 20, 2023
In json-split mode it is not necessary to keep all parent palette
information of every element in the installation. The current element
is sufficient and the array will be merged again when loaded.

This was not harmful before, but resulted in changes of every json file
which shares this field.

Fixes: #601
(cherry picked from commit 6db1849)
@nhovratov
Copy link
Collaborator

I could fix it! Will make a new release on Moday.

nhovratov added a commit that referenced this issue Oct 21, 2023
@schloram
Copy link
Contributor Author

Wow, that was quick! 💪

Thanks a ton for the fix! ❤️

@nhovratov
Copy link
Collaborator

No problem, this bothered me myself for some time now. But I wasn't motivated enough to fix it :)

Just update to v8.3.7 and save any content element. The json files will be clean afterwards.

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

No branches or pull requests

2 participants