We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When running on_the_web module I'm seeing a handful of PHP warnings, one for each icon:
Warning: Undefined array key "alt" in theme_icon() (line 327 of /var/www/html/docroot/core/includes/icon.inc).
Line 327 is as follows:
if (isset($variables['alt']) {
The warning comes because in hook_theme() we are not specifying alt as an allowed value:
hook_theme()
alt
'icon' => array( 'variables' => array( 'name' => NULL, 'path' => NULL, 'attributes' => array('class' => array()), 'wrapper_attributes' => array('class' => array()), ), ),
But when you call the icon() function to display an icon, we are passing the alt in as though it should were defined in hook_theme():
icon()
return theme('icon', array( 'name' => $icon_name, 'path' => $icon_path, 'alt' => $options['alt'], 'attributes' => $options['attributes'], ));
To reproduce the behavior:
$svg_options = array( 'alt' => 'alt-test', 'attributes' => array('class' => array('test-class)), ); icon('envelope', $svg_options);
Warning
No warning
Add any other information that could help, such as:
The text was updated successfully, but these errors were encountered:
PR at backdrop/backdrop#4910.
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
Description of the bug
When running on_the_web module I'm seeing a handful of PHP warnings, one for each icon:
Line 327 is as follows:
The warning comes because in
hook_theme()
we are not specifyingalt
as an allowed value:But when you call the
icon()
function to display an icon, we are passing thealt
in as though it should were defined in hook_theme():Steps To Reproduce
To reproduce the behavior:
icon()
to render one of the new core icons:Actual behavior
Warning
Expected behavior
No warning
Additional information
Add any other information that could help, such as:
The text was updated successfully, but these errors were encountered: