Altering existing checkbox custom fields
(Post refers to a site in development. I can provide login details to admins, though the site is undergoing heavy mod work, hence the caveat "Bug?" I've reverted showphoto.php & tmpl, editphoto.php & tmpl, pp-inc.php and other crucial files and the error is still evident.)
In PP 5.1x, I am now using several of the new custom (category) fields, and all work as desired except for the checkbox field(s). An example of a checkbox custom field I'm using, as defined in the relevant category, is:
Print Sizes to Offer
During photo uploads, my selections to this custom field are applied correctly to photos. For instance, if I select that the photo's available in print sizes 8x10 and 18x24, that is indeed what gets saved to the db and displayed on subsequent views of the photo (showphoto).
However, in a very specific instance (outlined below in bold), if I _EDIT_ the photo, the _ORIGINAL_ values I chose for this custom field are prefilled, and no amount of de-selecting them and resaving the photo make the changes stick. When I look in the DB, the values confirm they aren't being modified -- they're stuck to their original settings when I uploaded the photo.
This occurs in all categories using the same custom field (same content, obviously different id's in the database). And it only seems to occur to checkboxes in one specific but notable scenario -- Select at LEAST one of the checkboxes (check it off) on initial upload. Now, on edit, delete it so there are _NO_ selected checkboxes for that option. In this instance, it seems, PP doesn't pick up on the change. Whereas if I simply change my selection from one checkbox value (say 8x10) to toggling that off and selecting another (say 18x24), that change gets picked up fine -- 8x10 no longer is selected, and 18x24 is selected. But if _NONE_ of the values are selected on the edit, PP seems to just stay/revert to the originally selected values.
It should be noted that the dropdown and radio button custom fields behave as expected, accepting changes from original (set at time of upload) values to changes made upon editing the photo in PP.
Bug? If not a bug, that's fine. I'll have to figure it out myself and move this over to photopostdev. But in the off chance it's a bug, I'd like to hear if anyone else has experienced or reported this issue. I welcome someone with a fresh, unadulterated copy of PP 5.1x to test this as described above and report that it works fine for them. Follow the directions exactly, however. Simpling toggling one of the checkbox options off and enabling another doesn't cause the bug... having one initially toggled when the image is uploaded and deciding to deselect ALL checkboxes for that option is what causes the "stuck" values.
Last edited by Wild Texas; June 15th, 2005 at 03:32 PM.
Reason: elaboration & screencap