Skip to content

[Fix] 0045422: Use ButtonContextRenderer for Glyph in Filter and Mode…#11019

Merged
thibsy merged 3 commits intoILIAS-eLearning:release_11from
fhelfer:ui/mantis/45422
Feb 17, 2026
Merged

[Fix] 0045422: Use ButtonContextRenderer for Glyph in Filter and Mode…#11019
thibsy merged 3 commits intoILIAS-eLearning:release_11from
fhelfer:ui/mantis/45422

Conversation

@fhelfer
Copy link
Contributor

@fhelfer fhelfer commented Jan 30, 2026

Error: The element “a” must not appear as a descendant of the “button” element.
https://mantis.ilias.de/view.php?id=45422

Glyphs with action were rendered as and ended up inside ,
which is invalid. Extend USE_BUTTON_CONTEXT_RENDERER_FOR with
StandardFilterContainerInput and ModeViewControl so glyphs render
as in these contexts.

Problem

  • Validator: <a> als Nachfahre von <button> ungültig (z. B. Filter, Dashboard ViewControlMode).

Lösung

  • GlyphRendererFactory: StandardFilterContainerInput und ModeViewControl zu USE_BUTTON_CONTEXT_RENDERER_FOR hinzufügen → Glyphe als span in diesen Kontexten.

@fhelfer fhelfer added bugfix kitchen sink php Pull requests that update Php code labels Jan 30, 2026
@Annett7811 Annett7811 added the accessibility Pull requests that propose A11Y changes. label Feb 6, 2026
Copy link

@Annett7811 Annett7811 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello!

From an accessibility perspective, this looks good. Thank you very much for your work.

Best regards,

Annett

@oliversamoila
Copy link
Contributor

Hello @fhelfer
When I go to Mail » Inbox as described in the referenced Mantis issue and use the HTML validator, I still get errors of the type The element a must not appear as a descendant of the button element..
However, I consider these to be completely misleading, as they refer to 65115835.” ><a class="glyph" aria-label=“Tile View”>↩<span.
But: There is no ViewControl with these glyphs on these screens, nor are there any other places.

Do you @Annett7811 have these messages?

I would actually like to hand this over to Thibeau, but I'm stuck on it.

Best regards,
Oliver

@Annett7811
Copy link

Hello @oliversamoila!

No, I don't get this error message in combination with a button element.

Best regards,
Annett

@oliversamoila
Copy link
Contributor

Thanks @Annett7811
I'm forwarding this to @thibsy for code review. He may contact you with change requests or incorporate the changes directly (That includes cherry picking too.)

Kind regards,
@oliversamoila (as UI coordinator)

@dsstrassner
Copy link
Contributor

Das liest sich wie die falsche Vorlage für @Annett7811 😉

@oliversamoila
Copy link
Contributor

Hey @dsstrassner, das passt soweit ;)
Der Text 'contact you with change requests' richtete sich aber potenziell eher an Fabian.
Also ja, das geht sprachlich schöner, aber wird funktionieren … hoffe ich ^^

@dsstrassner
Copy link
Contributor

Nicht das Annett Angst bekommt das sie selbst den PR anpassen muss. Harhar. 🙃

Copy link
Contributor

@thibsy thibsy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @fhelfer,

Thx a lot for your contribution to the UI framework!

Please help me answer the following questions about your changes:

  • ModeViewControl: you say this component is also affected by the same issue. However, I cannot find a glyph usage in the ViewControl\Mode or the Input\ViewControl\Mode rendering. Are you sure this is relevant?

Please implement the following changes:

  • False-positives: I think once the StandardFilterInput is added to the USE_BUTTON_CONTEXT_RENDERER_FOR constant, every input that is contained inside such a filter will be rendered using this context renderer. I believe this creates false-positives. Please treat this component differently, by checking explicitly if its the current component, not just contained in the rendering chain. Maybe we should introduce a separate constant with appropriate documentation for this =).

Kind regards,
@thibsy (as UI coordinator)

@fhelfer
Copy link
Contributor Author

fhelfer commented Feb 17, 2026

  • ModeViewControl: you say this component is also affected by the same issue. However, I cannot find a glyph usage in the ViewControl\Mode or the Input\ViewControl\Mode rendering. Are you sure this is relevant?

Hey @thibsy,
this is used here

$this->addPresentation(
$this->ui->renderer()->render($this->ui->factory()->symbol()->glyph()->{$presentation . 'View'}()),
$this->ctrl->getLinkTarget($this, 'changePDItemPresentation'),

which later gets rendered into a ViewControl Mode Switch here

public function getViewControlsForPanel(): array
{
$viewControls = [];
if (count($this->presentations) > 1) {
$presentation = $this->factory->viewControl()->mode(
$this->presentations,
'label'
)->withActive($this->activePresentation);
$viewControls[] = $presentation;
}
if ($this->sort_options !== []) {
if (! array_key_exists($this->activeSortOption, $this->sort_options)) {
$this->activeSortOption = current(array_keys($this->sort_options));
}
$sortation = $this->factory->viewControl()->sortation(
$this->sort_options,
$this->activeSortOption
)->withTargetURL(
$this->sort_target,
'sorting'
);
$viewControls[] = $sortation;
}
if ($this->getPresentation() === self::PRES_SEC_LIST) {
$pg_view_control = $this->getPaginationViewControl();
if ($pg_view_control !== null) {
$viewControls[] = $pg_view_control;
}
}
return $viewControls;
}

It is the Dashboard Tile/List-Mode-Switch for each Block
image

@fhelfer fhelfer requested a review from thibsy February 17, 2026 09:42
@thibsy
Copy link
Contributor

thibsy commented Feb 17, 2026

@fhelfer ah, I see. This cannot be fixed using a context renderer then, because the component is already rendered outside of the filter context and passed along as a string. Or am I still missing something here?

@fhelfer
Copy link
Contributor Author

fhelfer commented Feb 17, 2026

Ah yes, you're right - this is the wrong example. I think I was trying to solve it in Dashboard and accidentally left this in.

However, it would still be good to have this, as glyphs used inside a Mode-Switch might be a common thing in the future.

Copy link
Contributor

@thibsy thibsy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @fhelfer, thx a lot for implementing the changes and for documenting this very precisely. Changes LGTM now, so I will integrate this in all maintained versions.

@thibsy thibsy merged commit d3b9bb0 into ILIAS-eLearning:release_11 Feb 17, 2026
5 checks passed
thibsy pushed a commit that referenced this pull request Feb 17, 2026
* Fixes https://mantis.ilias.de/view.php?id=45422
* Update `Symbol\Glyph\GlyphRendererFactory` and use for `Filter\Standard` as well
thibsy pushed a commit that referenced this pull request Feb 17, 2026
* Fixes https://mantis.ilias.de/view.php?id=45422
* Update `Symbol\Glyph\GlyphRendererFactory` and use for `Filter\Standard` as well
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

accessibility Pull requests that propose A11Y changes. bugfix kitchen sink php Pull requests that update Php code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants