Gernott / mask

TYPO3 Extension Mask
https://www.facebook.com/typo3mask
GNU General Public License v2.0
130 stars 86 forks source link

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

Closed schloram closed 1 year ago

schloram commented 1 year ago

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

nhovratov commented 1 year ago

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 commented 1 year ago

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

schloram commented 1 year ago

Wow, that was quick! 💪

Thanks a ton for the fix! ❤️

nhovratov commented 1 year ago

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.