getInteractions(); foreach ($interactions as $interaction) { if ($interaction instanceof PortableCustomInteraction && $interaction->getTypeIdentifier() === 'textReaderInteraction') { $response = $interaction->getResponse(); $currentDefaultVal = $response->getDefaultValue(); if(!is_array($currentDefaultVal) || empty($currentDefaultVal) || count($currentDefaultVal) !== 1){ $requireFix = true; }else{ $val = $currentDefaultVal[0]; $requireFix = !($val instanceof Value && $val->getValue() === 'true'); } if($requireFix){ $defaultValue = new Value(); $defaultValue->setValue('true'); $response->setDefaultValue([$defaultValue]); $changed = true; } } } return $changed; } }