Projects ⇒ Bugs ⇒ #640: Custom Yes/No Fields in My Account not working ⇒ CPG Dragonfly™ CMS
Bug #640 Custom Yes/No Fields in My Account not working
Project: Dragonfly 9.0.3 -> 9.3 Category: My Account
Submitted: Tuesday, October 04, 2005 (23:33:42) Modified: Sunday, May 21, 2006 (07:11:48)
Status: Closed Assigned to:
PHP Version: 4.3.10 HTTPD Server: Apache 1.3

View/Vote Add Comment

by: insaner
When logged in and going to My Account, I see correct information displayed in regards to saved Yes/No custom fields. Once viewing My Account, if I click the "My Public Profile" link, all the Yes/No fields change to Yes regardless of what's stored in the database. If I then click "My Profile Information" to edit the profile, all the Yes/No fields are automatically selected to no regardless of the settings in the database.

Here is a thread that talks about the issue:

Reproduce code:
1) Create custom Yes/No fields
2) Insert information into the Yes/No fields
3) Save, close browser
4) Re-open browser, login to site
5) click "My Account" link, notice Yes/No fields are correct
6) click "My Public profile" link in the left menu, notice that custom Yes/No fields are all set to "Yes"
7) click "My profile information" link in the left menu, notice that custom Yes/No fields are set to "Yes"
8) check database, notice values are the original correct values
9) close browser, and repeat... the first time you view the profile it'll be correct, anytime after that during the session it will not be correct.

Expected result:
The Yes/No fields should display the correct values from the database

Actual result:
The fields are distorted and do not display the correct information. All debug options look normal (I believe). Screenshots and more information can be found in this thread:

I've seen this on multiple computers with IE and Firefox
by: insaner
#7 on the list should read:

7) click "My profile information" link in the left menu, notice that custom Yes/No fields are set to "No"
by: insaner
Can anyone validate/reproduce this? It is still an issue for me... I'm running

by: NanoCaiordo
Bug id #711
Posted: Friday, December 16, 2005 (15:51:56) by: Biggles

Line 102 of modules/Your_Account/userinfo.php ver. 9.28 converts yes/no custom option fields from 1/0 to _YES/_NO. I don't know if it's intended to or not, but it can cause problems depending on the module you are in or the path you go through. For example, these fields will only be converted to _YES/_NO if you go to the Your_Account module. Lines 101-108 should be:
while ($row = $db->sql_fetchrow($result)) {
$value = $userinfo[$row['field']];
if ($row['type'] == 1) {
$value = ($value) ? _YES : _NO;
if (defined($row['langdef'])) {
$row['langdef'] = constant($row['langdef']);
echo '<tr>
<td valign="top" align="right" width="33%"><span class="gen">'.$row['langdef'].':</span></td>
<td><b><span class="gen">'.$value.'</span></b></td>
by: NanoCaiordo
This bug has been fixed in the CVS.

Snapshots of the sources are packaged every 6 hours; this change
will be in the next snapshot. You can grab the snapshot at the
Downloads section.

Thank you for the report, and for helping us to make Dragonfly 9.0.3 -> 9.1 better.
User Info

Welcome Anonymous


Support for DragonflyCMS in a other languages: