Project

General

Profile

Actions

Feature #61649

closed

Extbase settings merging (TS + FlexForm) should respect ".override" and ".ifEmpty" in FlexForms

Added by Gabriel Kaufmann / Typoworx NewMedia over 9 years ago. Updated 10 months ago.

Status:
Closed
Priority:
Could have
Assignee:
-
Category:
Extbase
Target version:
-
Start date:
2014-09-16
Due date:
% Done:

0%

Estimated time:
PHP Version:
Tags:
Complexity:
medium
Sprint Focus:

Description

I was just trying around how one could make a "default" TypoScript configuration for an Extbase-Plugin and being able to easily override settings from FlexForm.

One example:

we have the plugin in TypoScript:

  1. setting the "global" storagePid as default
    tx_testpluginpi1 {
    persistence {
    storagePid = {$plugin.testpluginpi1.persistence.storagePid}
    }
    }

In FlexForm we could use something like this:

<persistence.storagePid.ifEmpty>
<TCEforms>
<label>StoragePid</label>
<config>
<type>group</type>
<internal_type>db</internal_type>
<allowed>pages</allowed>
<size>1</size>
<maxitems>1</maxitems>
<minitems>0</minitems>
<show_thumbs>1</show_thumbs>
<wizards>
<suggest>
<type>suggest</type>
</suggest>
</wizards>
</config>
</TCEforms>
</persistence.storagePid.ifEmpty>

Usually one would use the key-name "persistence.storagePid" - which will definitely will override the TypoScript setting even if empty/unset!

Currently the FlexForm code above works fine - but is ALWAYS overriding the TypoScript setting "persistence.storagePid". But it works - which indicates, that the stdWrap seems to be already present there!

I think there's somewhere missing the "current" value set in PHP for the processing of the FlexForm values.

The solution mentioned above appending ".ifEmpty" is compliant as one knows this usage from TypoScript which makes this solution very handy!

Is there any chance to change this? If I'll get a hint where to find the right place I'll make a fix/patch for it, too.


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Feature #99976: Ignore empty flexform values in extbase extension settingsClosedTorben Hansen2023-02-17

Actions
Actions #1

Updated by Marc Hirdes almost 9 years ago

This would be very nice to have.

Actions #2

Updated by Petra Arentzen almost 9 years ago

I also wish this would be changed.

But after a look in the code (FrontendConfigurationManager::overrideStoragePidIfStartingPointIsSet()) I think the way to set persistence settings individually for a specific content element should be using the "Page"- and the "Recursive"-Field in Content-Record.

Nevertheless the problem for overriding other settings resists but can be solved by using another flexform field name eg. settings.flexform.xxx, which then can be manually merged with settings.xxx from typoscript - only if they're not empty.

Actions #3

Updated by Daniel Goerz over 8 years ago

  • Tracker changed from Bug to Feature
  • Priority changed from Should have to Could have
Actions #4

Updated by Torben Hansen about 1 year ago

  • Related to Feature #99976: Ignore empty flexform values in extbase extension settings added
Actions #5

Updated by Stefan Froemken 10 months ago

  • Status changed from New to Closed

Hello,

Thanks for your info. Using TypoScript syntax in FlexForm is not the way to go. I found a pretty cool website describing how extbase determines the storagePid: https://www.derhansen.de/2016/02/how-extbase-determines-storagepid.html

In your case:
Please define a fallback storagePid in:

plugin.tx_myext.persistence.storagePid = 12,54,124

An editor still can set another storagePid (override) in extbase plugin itself. If he leaves the value empty (ifEmpty) your fallback from above takes effect.

If you feel this is the wrong decision, let me know, and I will re-open it.

Stefan

Actions

Also available in: Atom PDF