Add cache tags to quick form help text render array
This commit is contained in:
parent
e23e5923dc
commit
3972ea268f
|
@ -23,11 +23,17 @@ function farm_quick_help($route_name, RouteMatchInterface $route_match) {
|
|||
if (strpos($route_name, 'farm.quick.') === 0) {
|
||||
$quick_form_id = $route_match->getParameter('id');
|
||||
if ($route_name == 'farm.quick.' . $quick_form_id) {
|
||||
/** @var \Drupal\farm_quick\Entity\QuickFormInstanceInterface $quick_form */
|
||||
$quick_form = \Drupal::service('quick_form.instance_manager')->getInstance($quick_form_id);
|
||||
$help_text = $quick_form->getHelpText();
|
||||
if (!empty($help_text)) {
|
||||
$output .= '<p>' . $help_text . '</p>';
|
||||
}
|
||||
$output = [
|
||||
'#type' => 'html_tag',
|
||||
'#tag' => 'p',
|
||||
'#value' => $help_text,
|
||||
'#cache' => [
|
||||
'tags' => $quick_form->getCacheTags(),
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue