- Issue created by @dtfabio
While going through the steps in this video Deep crawling using AI Interpolator[https://www.youtube.com/watch?v=5bcdfsNkaVs] I wanted it to select the advanced mode option.
But I was shown a different settings form as in the video, I then remembered that the video briefly mentioned de token module. I then went to look in the form's code, because I would expect to see help text indicating "token must be enabled to use this".
This is added to the code only this description is in an if, that only shows this description if the module is already enabled, which somewhat defeats the purpose of the text.
if ($this->moduleHandler->moduleExists('token')) {
$form['interpolator_container']['interpolator_mode'] = [
'#type' => 'select',
'#title' => $this->t('Interpolator Input Mode'),
'#description' => $this->t('If you have token installed you can use it in advanced mode, otherwise it uses base mode.'),
'#options' => $modeOptions,
'#default_value' => $fieldInfo->getThirdPartySetting('ai_interpolator', 'interpolator_mode', 'base'),
'#weight' => 5,
'#attributes' => [
'name' => 'interpolator_mode',
],
];
}
else {
$form['interpolator_container']['interpolator_mode'] = [
'#value' => 'base',
];
}
Install and enable the AI Interpolator module without enabeling the token module.
When enabeling AI Interpolator on a text field, this description is shown under Interpolator Base Field:
"This is the field that will be used as context field for generating data into this field."
I would add a part to this text so that in both cases it is mentioned for advanced mode to have to enable the token module.
E.g. "This is the field that will be used as context field for generating data into this field. If you want to use advanced mode, the token module must be enabled."
Decide how best to solve this problem, modify the code, create an MR, review MR and merge if correct.
Some extra text will be added to the settings from.
Active
1.0
Code