mullema / k3-image-clip

Visually crop images with a handy image editor directly inside the panel
MIT License
40 stars 4 forks source link

Compatibility with Kirby 3.6 #17

Closed mynameisfreedom closed 2 years ago

mynameisfreedom commented 3 years ago

The field doesn't work with Kirby 3.6.0-alpha.4.

mullema commented 3 years ago

The develop branch works with Kirby 3.6.0-beta.2

mynameisfreedom commented 3 years ago

You are the man 💪

mullema commented 3 years ago

Thank you for the coffee(s) :)

ChristophLabacher commented 2 years ago

Hi and thanks for creating this awesome plugin!

Unfortunately it doesn’t work for me with the released version of Kirby 3.6.

I am using it in my blueprint like this:

          teaser_image_square:
            type: image-clip
            label: Teaser Image Square
            multiple: false
            query: page.images
            layout: cards
            clip:
              minwidth: 100
              minheight: 100
              ratio: fixed

When I select an image in the Panel it works (and the field is saved to the pages txt file). I then click on the crop button, adjust the position of the cropping and press save. Everything looks fine int the panel, but in this moment the saved information for the field is removed from the pages txt file. When I reload the panel, the field is empty again.

mullema commented 2 years ago

Hi @ChristophLabacher Which branch are you using? I do not have the time to debug this at the moment.

ChristophLabacher commented 2 years ago

I am using the latest development branch. I would love to help fix this, but am not sure where exactly to look.

mullema commented 2 years ago

@ChristophLabacher I am not able to reproduce the problem you are describing. Are you on a fresh Kirby 3.6 install? Local or remote environment? Which one?

ChristophLabacher commented 2 years ago

@mullema It’s a local Kirby 3.6 instance, it’s not exactly fresh as I am also using some other plugins. I will create a fresh installation and try again and report back to you. Thanks for looking into this!

Adding some log statements I could figure out that when I select an image for the Field and save immediately (without opening the clipping modal), the save function from fields/image-clip.php does get called (and the field value is persisted when I reload the Panel), but when I open the clipping modal, change the position, press "ok" and then save the function does not get called.

mullema commented 2 years ago

What browser are you using?

ChristophLabacher commented 2 years ago

You are right, everything works fine in a fresh install of the starter kit – so this has to be a problem with my configuration. Sorry to bother you with it! I am currently trying to figure out what breaks it by slowly moving the starter kit towards my configuration.

I was using Chrome for testing.

mullema commented 2 years ago

No worries. I'm also interested to see what breaks it.

ChristophLabacher commented 2 years ago

Unfortunately I wasn’t able to figure it out. In the end I used the starter-kit project and copied everything over from my project, including templates, blueprints, snippets, models, plugins, content, assets etc. – even in git I wasn’t able to find a change that might be causing it in the few files that changed. Maybe it was some rights issue with the content directory?

mullema commented 2 years ago

If it was a permission issue it wouldn't work at all I assume. Maybe a caching issue?