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.
Well If a photo has an extra field it can certainly be changed. I beleive the issue here is you can not change the entry if editing a photo in the category that does not have an custom extra defined CORRECT?
The problem being there is you cant run an update on something thats empty it would need to be an insert. So one of two things needs to happen here. We need to do an explicit check on the photoextras table and if there are no entries do not display those fields on edit or if the photoextra table is empty add the ability to inser an entry not upgrade query
Has this change been applied to the 5.12 release? I'll be upgrading to that, and I assume this code fix was incorporated?
Addendum: This doesn't appear to address the issue. Currently running 5.11 on the site with the issue. Issue is, as described, limited to editing checkbox custom fields such that NONE of the checkbox options for a particular field are checked, after having initially uploaded the image with one or more checkboxes selected in a particular field. Occurs on all checkbox fields.
If this is addressed/resolved in 5.12, let me know. That would save a chunk of time as this issue has remained outstanding on the site I was upgrading to 5.11.
This is in 5.12 and I surely am able to edit and change extra fields with the code I provided above where as before you could not.
Check your PM here. I've sent you login details for a stock install of 5.12 that exhibits exactly the problem I'm referring to. In my PM I repeat the issue for you to walk through the stock install and recreate the error for yourself.
The problem, which still exists is specific to having checkboxes selected and then unselecting ALL of the items (to clear out any checkboxes). Because the POST doesn't send us any info because nothing is checked, we don't know to clear out all the data. It's something that we are still looking into as it may require an addition field to check for clearing all options.
Thanks for the update, Michael. I'll keep my fingers crossed. :)
|All times are GMT -5. The time now is 06:22 PM.|
Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0