In the add preset form you can enter in any name for a preset, and even enter a namespace that has already been used. It appears this is because incorrect usage of '#validate' in imagecache_ui_preset_add_form(), and incorrect usage of in_array (in_array does not recursively search for needle) in the validation function.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

q0rban’s picture

FileSize
1.72 KB

Oh, I guess we should make the namespace element required as well. Otherwise you can actually leave the field empty and still pass validation.

q0rban’s picture

FileSize
2.45 KB

Same problems in preset edit form.

drewish’s picture

Status: Needs review » Fixed

good catches, thanks. committed to HEAD.

drewish’s picture

Status: Fixed » Active
q0rban’s picture

Status: Active » Needs review
FileSize
984 bytes

As far as I can tell, there's really no reason for anyone to be able to edit the namespace after it's been created. I don't see anything in there handling the move of the imagecache directory that's been created. So, I just removed the textfield for the presetname and the validation call for the edit form.

drewish’s picture

that seems reasonable to me. follows the views and cck pattern. and once #255421: Patch for imagecache preset exporting lands you could export it and import with a new name

drewish’s picture

Status: Needs review » Fixed

committed to HEAD.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.