When creating an image-clip field, I get this error message:
Anyone using this plugin have any idea, how, why? I checked the source and didn’t find anything looking like a wrong indent or something like that. It has 10 stars already, so I guess there are people using it just fine
I just installed it in a fresh kit and have no error.
Do you get more information in the console? Does the error persist if you replace image-clip with files in your blueprint, to make it a normal files field?
There’s nothing special here, what do you think @texnixe?
What could be causing this specific error?
// Edit: When choosing another name for my field, it works as expected. I’m not fond of changing my field name, as cover is exactly what it is … I’ll tell the plugin author over at Github and maybe we can sort this out … thanks for your effort, as always!
Will check that. Most content files were there from the beginning of K2 - any method to clean them, and only keep what’s actually defined in the corresponding blueprint file?
// Edit:
Well, my problem persists, and it might be even harder to debug:
Now, I enter an image, save the page, visit another page, and everytime I come back, the field has the error shown above. When I change the field name once more, reload the page: I can select an image again! But, when saving, leaving the page, coming back: again, Illegal offset error …
Front: die-muskeltiere-einer-fuer-alle-alle-fuer-einen_ute-krause.jpg
// as well as this:
Front:
- die-muskeltiere-einer-fuer-alle-alle-fuer-einen_ute-krause.jpg
Sadly, this would mean that it’s not possible to just replace / dropin this plugin, and I would have to change about 100+ entries by hand?! It’s not as compatible as swapping toFile() with toImage() …
So you WERE right, as always - I get it now … woof, thanks for hanging in there with me …
I think he she (pardon me) wanted to know how you would go about ‘cleaning’ a content file (actual code example, etc), maybe that would be a good idea for a plugin?
@S1SYPHOS thank you for finding this. I haven’t considered that fields are just swaped out, but it is a valid use case. I will look into it and see whether the plugin can or should handle it. Changing the content file structure automatically could be a problem if you decide to go back to the core images field…
I would use your Field all the time, since Many Clients expect such functionality, but for me it has to be a dropin-replacement for the files Field (changing toFile to toImage would be okay I guess)
@moeli As a first step, you could at least put a note into your readme that you can’t simply replace one field for the other.
Making this an automatic process is not without issues I think, and there should be a way back. Maybe rather provide two scripts to handle this manually after having made a backup?