From keb at cyblings.on.ca Mon Apr 4 00:38:39 2011 From: keb at cyblings.on.ca (krishna e bera) Date: Sun, 3 Apr 2011 19:38:39 -0400 Subject: [Petition-Developers] hide fields Message-ID: <20110403233839.GA18374@cyblings.homelinux.net> hi guys, I am confused by some of the recent changes to the fcpetition.php When the databsae contains the value 1 in the Hide column, i would expect the field to be hidden but the code is reversed - it shows the field on a 0. To set this aright, i needed to make 3 changes. Diff below: @@ -951,7 +951,7 @@ if (count($res) > 0) { ?> - + @@ -1020,7 +1020,7 @@ $output = ""; if(count($res)>0) { foreach($res as $row){ - if($row->hide == 0) { $lmsg = __(" (won't be published)","fcpetition");} else { $lmsg = "";} + if($row->hide == 1) { $lmsg = __(" (won't be published)","fcpetition");} else { $lmsg = "";} if($row->type == "text") { $output .= "$row->name$lmsg:

\n"; } elseif($row->type == "select") { @@ -1112,7 +1112,7 @@ unset($package[$fieldname]); next; } - if(0 == $hide[$fieldname]) { + if(1 == $hide[$fieldname]) { $package[$fieldname] = "xxxxxxx"; unset($package[$fieldname]); next; Now of course the patch above is invalid if you have changed the database schema, but i do not know how or where such a change would have been announced. -- Krishna E. Bera keb at cyblings.on.ca gpg 0xB8B5E809 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 482 bytes Desc: Digital signature URL:
NameTypeOptionsPrinted
NameTypeOptionsHide