Skip to content

Commit 9ef9534

Browse files
committed
fix(checkboxesfield): replace div with p in checkbowes answers
1 parent 2108983 commit 9ef9534

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

inc/field/checkboxesfield.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ public function getValueForTargetText($domain, $richText): ?string {
264264
}
265265

266266
if ($richText) {
267-
$value = '<div>' . implode('</div><div>', $value) . '</div>';
267+
$value = '<p>' . implode('</p><p>', $value) . '</p>';
268268
} else {
269269
$value = implode(', ', $value);
270270
}

tests/3-unit/GlpiPlugin/Formcreator/Field/CheckboxesField.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -284,21 +284,21 @@ public function providerGetValueForTargetText() {
284284
'values' => "[]"
285285
]),
286286
'value' => json_encode(['a']),
287-
'expected' => '<div></div>'
287+
'expected' => '<p></p>'
288288
],
289289
[
290290
'question' => $this->getQuestion([
291291
'values' => json_encode(['a', 'b', 'c'])
292292
]),
293293
'value' => json_encode(['a']),
294-
'expected' => '<div>a</div>'
294+
'expected' => '<p>a</p>'
295295
],
296296
[
297297
'question' => $this->getQuestion([
298298
'values' => json_encode(['a', 'b', 'c'])
299299
]),
300300
'value' => json_encode(['a', 'c']),
301-
'expected' => '<div>a</div><div>c</div>'
301+
'expected' => '<p>a</p><p>c</p>'
302302
],
303303
];
304304
}

0 commit comments

Comments
 (0)