I'm having a really hard time deleting a menu icon, or replacing an existing icon with another. In the UI there's no "delete" button, to remove the existing image, and uploading a new image does not change the icons in the menu. The file name in the path textfield remains the same, so I can't tell if the new file I uploaded is doing anything at all.
1) add a delete button to remove the existing icon. I keep trying to delete the value in the path field, but that won't save. Uploading a new file also does not seem to replace the existing one.
2) do not change the name of the file when uploaded. How is a user supposed to know what public://menu_images/menu_icon_1183.jpg looks like? but bunny.png means something to me, as does the replacement, puppy.png
3) Flush the image cache on change. Using image styles means that when the original image changes, the derivatives need to be deleted so they can be re-generated on-demand. (This would be less of a problem if the new and old files did not have the same name.)
4) Maybe consider using the managed_file form element instead of just file. This will store and track these files in the files table, and make the process of managing the menu icon files a little easier. (Plus, it has a delete button!)
Comments
Comment #0.0
jenlamptonadded delete bonus
Comment #1
acrollet commentedThanks for the valuable feedback! I'm currently focused on getting a really solid 1.0 put together, so I've added item #3 as a separate ticket: #1460228: Correctly generate imagecache derivatives
These items will be the next priority.
Comment #2
jenlamptonAwesome, thanks for all your great work on this. :)
I've also created #1460748: Sex up the UI with form #states for when you get time to work on more UI stuff.
Comment #3
rogical commentedIt seems need to upload twice to successfully replace a icon, this is a bug
Comment #4
acrollet commented@rogical: it doesn't in fact take two uploads to change the icon, it just takes a refresh to see the new icon after uploading. I'd like to implement jenlampton's suggestion to use the managed_file form element, but don't have time at the moment. Postponing until someone uploads a patch or I get time.
Comment #5
rooby commentedThe issue some of you are experiencing might be related to #1293244: CSS (cache) files not automatically rebuilt when the css file changes. Try the patch there and see if it helps.
Also, if the UI does get an overhaul, it would good to also consider #1996942: Allow selection of existing menu icons if possible.
Comment #5.0
rooby commentedclarify the need for a delete button