Skip to content

Update to 2.0.8 losing all icon values in CP/GraphQL #66

@ctigelaar

Description

@ctigelaar

I upgraded a site to Craft 4, including v2.0.8 of IconPicker. Somehow the migration of the icons went not perfect, because I have no icons anymore. As in, in CP the stored value in DB is not selected anymore and GQL is not returning any value. It looks like #60, but that one should be resolved in 2.0.8, but my bug is introduced in that version.

I did some debugging and found out that in the convertModel method in the migration (https://github.com/verbb/icon-picker/blob/craft-4/src/migrations/m221111_000000_modernize_model.php), you are checking for a $type variable. If it exists you are migrating, if not you are not performing anything. Well, that's where it goes wrong, because my values stored in the database have type: null, see below:

{
"icon":"/urban-building/008-school.svg",
"sprite":null,
"glyphId":null,
"glyphName":null,
"iconSet":null,
"type":null,
"css":null,
"width":null,
"height":null
}

If I manually convert icon to value and type to svg the CP is showing my icon again in the field.

I'm an IconPicker user since 1.1.10 and always performed the updates all the time, so I don't know what happened in the meantime. But the fact that the if/else branching stops on checking if $type exists seems to rough, because I didn't get any error during migration or whatsoever.

Maybe you can provide me a migration file to fix my values so everything works again? Would be highly appreciated.

N.B. Because I also had this issue (#64), I installed dev-craft-4 as 2.0.8 today, but the bug with missing values was introduced by updating to v2.0.8.

Steps to reproduce

  1. See description

Craft CMS version

4.3.4

Plugin version

dev-craft-4 as 2.0.8

Multi-site?

No

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions