Side Menu not Showing Icons with Platform-6.8.1

Hi,

My application has a “Main Window with side Menu” and I defined some icons to the menu items, like the next image:

screen1

It was working fine with platform-8.6.0, but after I upgraded to version 8.6.1 the icons are not showing any more and I get a couple of warnings:

WARN [http-nio-8080-exec-6/yfams/admin] com.haulmont.cuba.web.gui.icons.IconResolverImpl - There is no IconProvider for the given icon: branding/dashboard.png

If I go back to 6.8.0 it works again.

Do I have to change anything in the application or this could be a bug?

Thank you,

Claudio

Hi, @claudio.montenegro

It is a bug and it will be fixed soon.

Please track an issue in YouTrack: link.

As a workaround I suggest that you create your own implementation of com.haulmont.cuba.web.gui.icons.IconProvider that will provide icons from custom folders. You can find more information about it in our documentation: link.

Here is a small example:

@Component
public class BrandingIconProvider implements IconProvider {

    @Override
    public Resource getIconResource(String iconPath) {
        if (StringUtils.isEmpty(iconPath)) {
            throw new IllegalArgumentException("Icon path should not be empty");
        }

        return new VersionedThemeResource(iconPath);
    }

    @Override
    public boolean canProvide(String iconPath) {
        return iconPath.startsWith("branding/");
    }
}

Regards,
Daniil.

Hi Daniil,

OK, thank you for the workaround suggestion.

Regards,

Claudio

Hello, @claudio.montenegro

the problem is fixed. New changes will be published in the next bug fix release.

Regards,
Daniil.

1 Like

Hi Daniil,

Great! Thank you.

Regards,

Claudio