Closed SteinRobert closed 5 years ago
https://github.com/divio/djangocms-icon/commit/3fb2c1a0946349c0d04f7ef8f0d315b652160a65 should've fixed this problem
any chance you are using it on Divio Cloud? if that's the case and the addon was upgraded - please make sure that the static files and template are removed from the project.
i will try to reproduce in the meantime
I'm using version 1.0.0. Let me know if you cannot reproduce the issue. I'll have a look at removing the templates and statics. It is indeed a customized docker image we're using.
Edit: I deleted the statics and templates - this did not change the behavior. Selecting an icon from the 2nd iconset leaves the user with a preselection of the first icon of the first iconset when opening the admin/plugin again...
Edit2: @vxsx I noticed this behavior only with 2 SVG sprites so the first step of the reproduction is wrong. The setting should look like this:
DJANGOCMS_ICON_SETS = [
(ICONSET, 'icon', 'SVG icons'),
(ICONSET2, 'icon2', 'SVG icons 2'),
]
I can reproduce the problem with 2 svg iconsets, thanks, looking into this
It looks like the field renderer tries to infer the iconset out of the icon name:
Meaning that if value is icon-something
it would think that the prefix is icon
. So it would select the iconset based on that. And in case the iconset prefix doesn't match the one in settings it would always pick the first one no matter what. This is likely what leads to the bug you're experiencing
I can confirm this. Changing the prefix in my second symbol-def SVG file make the whole thing work.
There is a problem with the icon selector widget using multiple icon sets.
Example:
If one does select an icon from "SVG icons 2" and saves the plugin, opens it again, the wrong icon will be preselected (first of "SVG icons"). Steps to reproduce: