Style Editor Legend Preview is not consistent with actual style

Description

The Style editor fetches the custom legend image from the same folder of the style, if it does not find it, it searches in the main "styles" directory.
The WMS will only search in the same folder of the style.

So if the image is in the main "styles" directory, and the style is actually inside a workspace, the preview will still show a correct preview, when the WMS will fail to fetch the legend image and fallback to the generated one.

The two different behaviors should be aligned.

To reproduce:

NOTE: This is testable on vector styles only until is merged (it prevents raster styles to show custom legends at all)

Environment

Latest platform independent binary package on Windows 10

Assignee

Unassigned

Reporter

Gnafu

Triage

None

Fix versions

None

Affects versions

Components

Priority

Medium
Configure