Hi,
thanks for the quick response. I want to clarify the problem I’m seeing with $groupA and the group handling:
1. Debug Mode
When I run the survey in debug mode, this is the output:
[Information] Interview gestartet (neue Nummer 1318)
[Information] Der Fragebogen t00-B im Projekt StressorCreation2 wird verwendet
[Verarbeitung] Erstelle Seite 13 in Fragebogen t00-B
[Information] Entsprechend setPageOrder() werden nun folgende Seiten gezeigt:
14 [error], Ω (end)
debug() Inhalt: $groupA = false (boolean)
debug() Inhalt: $keyGroup = GROUP- (string)
[Information] Folgende Platzhalter sind vorbereitet:
%groupB% = (Text) -
%groupA% = (Text)
%keyGroup% = (Text) GROUP-
So in this situation, $groupA is false, and $keyGroup is just "GROUP-". I assume bc the debug mode does not access the "Datenbank für Inhalte"?
2. Pretest (clicking through as a participant)
When I activate the survey and test it like a normal respondent, the placeholders return values from the “Datenbank für Inhalte”:
replace('%groupB%', $groupB);
replace('%groupA%', $groupA);
replace('%keyGroup%', $keyGroup);
Output:
$groupB: -
$groupA: A-FK
$keyGroup: GROUP-CARCT7H2T2
This matches the entry in the content database:
GROUP-CARCT7H2T2 ger A-FK 23.09.2025, 16:37
So the content is definitely stored and retrievable.
3. The Dilemma
Even though %groupA% correctly resolves to A-FK, the if/else condition in my code acts as if $groupA is false and runs the fallback branch:
} else {
$groupB = '-'; // fallback if no mapping exists
setPageOrder('error', 'end');
}
If I hardcode, for example, $groupA = 'A-FK; the condition works as expected setting the following pages: MA1, MA2, end. Here the debug:
[Information] Interview gestartet (neue Nummer 1322)
[Information] Der Fragebogen t00-B im Projekt StressorCreation2 wird verwendet
[Verarbeitung] Erstelle Seite 13 in Fragebogen t00-B
[Information] Entsprechend setPageOrder() werden nun folgende Seiten gezeigt:
17 [MA1], 18 [MA2], Ω (end)
debug() Inhalt: $groupA = A-FK (string)
This leads me to think that the value retrieved from dbGet() might contain hidden characters (whitespace, newline, encoding issues) so it does not match 'A-FK' or 'A-KO' in a strict comparison.
4. My Question
Is there a recommended way to normalize or check values coming from the content database (e.g. trim() )? Or is there a better way to debug what exactly $groupA contains at runtime, beyond just debug($groupA);?