CoreCommunity ExtensionsIncubatorDistributionsTYPO3 4.5 ProjectsTYPO3 4.6 ProjectsTYPO3 4.7 ProjectsTYPO3 6.0 ProjectsTYPO3 6.1 ProjectsTYPO3 6.2 Projects (+)

Feature #10019

Finisher_DB: allow setting constant/fixed values via postProcessing

Added by Christian Weiske over 2 years ago. Updated over 2 years ago.

Status:Closed Start date:2010-10-01
Priority:Should have Due date:
Assignee:Reinhard Führicht % Done:

100%

Category:Finisher
Target version:Stable v1.0
Votes: 0

Description

When saving into the database, I need to set some fields to hard-coded values.

At first I tried:

fields.fieldname {
    postProcessing = TEXT
    postProcessing.value = some hardcoded string
}

The problem now is that Finisher_DB::parseFields() overwrites the value instead of setting it only when it does not exist.

Maybe there is a better way to do it, but I didn't find it. Using a preprocessor for default values doesn't work here since the user would be able change the POST values anyway.

So I suggest that Finisher_DB sets the value only itself if it does not exist yet, for pre- and post processors.

support_hard_coded_values_in_postprocessor_and_preprocessor.patch (1.2 kB) Christian Weiske, 2010-10-01 13:19

History

Updated by Reinhard Führicht over 2 years ago

  • Category set to Finisher
  • Status changed from New to Needs Feedback
  • Assignee set to Reinhard Führicht
  • Target version set to Stable v1.0

I haven't tried it myself, but why don't you just set the fixed value in mapping?

fields.fieldname {
    mapping = some hardcoded string
}

Updated by Christian Weiske over 2 years ago

I tried the mapping you suggested already and it does not work - it is only to map form fields to database fields.
So both sides (fieldname and mapping value) need to be valid form field or database column names.

Updated by Reinhard Führicht over 2 years ago

I just tried myself and indeed my suggested TS doesn't work.
But I managed to make it work this way:

fields.fieldname {
    mapping = TEXT
    mapping.value = some hardcoded string
}

Updated by Christian Weiske over 2 years ago

Right, that does actually work. No need for the patch then.

Updated by Reinhard Führicht over 2 years ago

  • Status changed from Needs Feedback to Closed
  • % Done changed from 0 to 100

Also available in: Atom PDF