The sample code for hook_icon_browser() allows us to pass an empty array for icon SVGs that are in a module's icons subdirectory:
function hook_icon_info() {
// For icons simply located in a module's "icons" directory, just provide the
// name of the file (minus ".svg") as the array key. This can be used to
// override core icons if the name of the icon matches a core one, or provide
// new ones if the name is unique.
$icons['my-module-icon1'] = array();
// <snip>
return $icons;
}
Which means that we ought to be able to do this in a module with two icons in its icons subdirectory:
/**
* Implements hook_icon_info().
*/
function icon_browser_test_icon_info() {
$icons['acorn-fill'] = array(); // Override the core 'acorn-fill' icon
$icons['test-acorn-fill'] = array(); // Create our own new icon
return $icons;
}
However, if we do, there are two problems. First, in the Icon Browser, the name of overridden acorn-fill is lost:
Second, if we set "Module" as provider, we get two icons with no name:
Attached is a small test module that can be used to verify the issue.
The sample code for
hook_icon_browser()
allows us to pass an empty array for icon SVGs that are in a module'sicons
subdirectory:Which means that we ought to be able to do this in a module with two icons in its
icons
subdirectory:However, if we do, there are two problems. First, in the Icon Browser, the name of overridden
acorn-fill
is lost:Second, if we set "Module" as provider, we get two icons with no name:
Attached is a small test module that can be used to verify the issue.
icon_browser_test.zip