Skip to content

Problem with multi checkbox and manipulateVariablesInPowermailAllMarker #1292

@maikusch

Description

@maikusch

What:

  • Having a multi checkbox in a form
  • check multiple answers in form
  • use the manipulateVariablesInPowermailAllMarker in typoscript
    manipulateVariablesInPowermailAllMarker { submitPage { # manipulate values by given marker (e.g. firstname, email, referrer) with TypoScript - available fieldnames (access with .field=): value, valueType, uid, pid veranstaltungs_kategorien = TEXT veranstaltungs_kategorien { field = value stdWrap.postUserFunc = In2code\In2template\UserFunc\CategoryIdsToTitles->mapIdsToTitles } } }

Problem:
Because the checkbox is one field in powermail, the chosen values of the checkboxes are saved as a string in answers table like "["35", "26", "24"]"
This ends up with multiple calling of the manipulateVariablesInPowermailAllMarker, with always the same saved value. So one can not, for example, replace ids with labels from a table. You can, but the result is also returned multiple times.

in my example i had 3 ids, and wanted to return a text with the id and the category name behind (35: Label of category name...)
This ends up in a string with 3 times the same string. Because i have 3 category-ids

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions