bacbos / bolt-menu-editor

a visual menu-editor extension for the awesome bolt cms
Other
21 stars 23 forks source link

[BUG] Issue when saving menu-item with customfields #66

Closed melcarthus closed 6 years ago

melcarthus commented 7 years ago

BOLT 3.3.1 Menu editr 3.2.2 Translate 4.0.9

I have added two extra fields for translation purposes. On saving the menu item I get the fields as aspected.
image

Only after filling the fields, saving and opening the menu-item again I see the default fields are there again together with the extra fields I just saved.

image

I'm I doing something wrong or is this a bug?

My config looks like this

# Backup settings
backups:
    enable: true # Whether to enable backups or not
    folder: 'config://extensions/menu_backups' # This has to be a filesystem path
    keep: 10 # How many backups to keep

# You can define fields in addition to the ones that already exist on menuitems.
# These are key-value pairs of name and default value and will be added (with
# that default value) to all existing items that do not have that field yet.
# You can not use the terms id, nestedSortableItem and nestedSortable-item.

fields:
   Delabel: 'Duitse menu naam'
   Detitle: 'Duitse link titel'

# If addcustomfields is set to false you are not able to add or delete your own fields.
# Only the predefined fields are available then.

# addcustomfields: true

# Add extra options to your menu item fields.
# There are 4 types of fields and the fallback is a text input.
# text: Add a input text field.
# textarea: Add a textarea if you need more chars.
# checkbox: Add a checkbox for lettng the editor easily toggle menu features or so.
# select: Prevent miss spelled values and let the editor just select from a couple of options
# The select needs a property values with key: value pairs.
# Default all fields can be deleted. If you want to avoid the deletion, add delete: false.

menufields:
    main:
        type:
            type: select
            values: {image: Image, something: Just something else}
        image:
            type: text
            delete: false
        path:
            delete: false
        use_icon:
            type: checkbox
        tooltip:
            type: textarea

# Permission for the menu editor
# Use an existing permission from the /bolt/roles page, or create your own
permission: files:config
melcarthus commented 7 years ago

Nothing is saving correct either. It wil only save 1 menu item correctly. But when I edit another and save the menu again only the last save is saved, and the previous menu-item is reverted back to image nr 2, it loses its settings.

ankedsgn commented 6 years ago

+1 Kind of the same issue;

Steps that I take:

Really weird behaviour, could you take a look at it? Thanks, and thank you for the extension! It makes my clients smile.. :)

using: Menu Editor 3.2.2 Bolt 3.4.2

SvanteRichter commented 6 years ago

@anketwokings @melcarthus Are both of your configs using uppercase characters for the key? I'm just scanning over it here, but it's not completely off that might be the issue.

melcarthus commented 6 years ago

@SahAssar I'll have to dust of this project because i have not been working on it for a while. But will let you know if this is the case soon if nobody else beats me to the punch.

ankedsgn commented 6 years ago

@jadwigo can you answer this?

Are both of your configs using uppercase characters for the key?

jadwigo commented 6 years ago

We're using lowercase keys .. the menu.yml is the followoing (a bit truncated)

main:
    -
        label: Traineeopleidingen
        path: landingpage/traineeopleiding
        submenu:
            -
                label: 'Profiel en toelatingseisen'
                path: page/toelating-en-selectie
            -
                label: 'Selectieprocedure 2017'
                path: page/selectiestappen
            -
                label: 'Traineeopleiding Wetgevingsjurist'
                path: page/de-wetgevingsjurist
                options: is-first-sub
                submenu:
                    -
                        label: 'De opleiding'
                        path: page/wetgevingsjurist-opleiding
                    -
                        label: Impressiefilmpjes
                        path: page/wetgevingsjurist-impressiefilmpjes
                        options: link-in-knop
                    -
                        label: 'Meld je aan als geïnteresseerde'
                        path: page/inschrijven_traineeopleiding
                        options: link-in-knop
    -
        label: 'Cursussen en maatwerk'
        path: landingpage/cursusoverzicht
        submenu:
            -
                label: E-learning
                path: page/e-learning
                options: link-in-knop
            -
                label: Maatwerk
                path: page/maatwerk
                options: is-first-sub
                submenu:
                    -
                        label: Werkwijze
                        path: page/werkwijze
                    -
                        label: Locatie
                        path: page/locatie
                    -
                        label: 'Eerder maatwerk'
                        path: page/eerder-maatwerk
                    -
                        label: Internationaal
                        path: landingpage/internationaal
    -
        label: 'Mijn Academie'
        path: page/mijn-academie
        class: hide-for-desktop
    -
        label: Contact
        path: page/contact
        class: hide-for-desktop
    -
        label: English
        path: landingpage/english
        class: hide-for-desktop

header:
    -
        label: 'Mijn Academie'
        path: page/mijn-academie
    -
        label: Contact
        path: page/contact
    -
        label: English
        path: landingpage/english
ankedsgn commented 6 years ago

@melcarthus This is probably fixed in the new version, 3.2.3. Can you confirm? thx!

SvanteRichter commented 6 years ago

Closing cause fixed, let me know otherwise.