0

I've installed Craft Personal 2.5.2763, and have set up my own simple blog.

For each Entry in the Blog Channel, I've set up an Asset Field, which is used for the header image displayed on the blog entry template.

I'd like this Asset field to be optional, as I'll be displaying a default image if one isn't defined in the Control Panel.

Adding an image to the field works great, but I'm seemingly unable to remove it once it has been assigned and saved when I go to edit the Entry and click the "Remove" icon.

Screenshot of CP remove asset

When clicking the Remove icon, The image disappears from the CP edit page as you'd expect, but when clicking "Save", it seems the removal of that image is not actually being saved, as it is still there when I go back in to edit the Entry.

UPDATE: I've also found this issue on a normal Text field too. If you set the Text field to some data, save, then go back to edit, delete all text, save, then the data is not removed and the original data remains.

Am I doing something wrong, or is this a bug?

Thanks in advance for any help.

1

Does everything else seem to be working? Maybe try removing the field from your section and then re-add it?

You might also try clearing the caches: Settings -> Clear Caches.

Craft logs various things to craft/storage/runtime/logs/craft.log If there's an error of some kind, maybe with your database, it'll show up there.

If that doesn't clear it up, shoot P&T a message and have them take a look at your install. You can do that right from the control panel.

| improve this answer | |
  • Everything else is working just fine. The log contains so much data that I can't really make any sense of it - there's not anything in there that looks like an error, and the CP doesn't display any error messages which I would expect if there was a DB or application error. I've sent a message to P&T for further analysis, as this would seem to be a bug. – binarymonkey Feb 22 '16 at 11:19
0

After speaking with Brandon from the Craft team, we narrowed this issue down to a PHP module called Suhosin.

The module apparently strips POST variables that are zero length / empty, before they hit PHP. Craft needs to see those to know the field is to be set to empty, otherwise the field won't be changed.

The Suhosin config setting suhosin.post.disallow_nul may help others who wish to keep Suhosin running, however I opted to simply remove the module entirely after reading a few less than favourable notes about it elsewhere.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.