Page 1 of 1

[Solved] Checkboxes Auto Selected (Not Wanted)

PostPosted: Tue Nov 17, 2009 8:06 am
by cyberws
Hello Group,

I have a single field that has several checkboxes to be selected (checked) if that item corresponds to the entry. The vocab is correct and it works the only problem is ALL the checkboxes are automatically selected when clicking on "New Record".

That means if a record/entry doesn't have same options 2, 4, 5 you have to uncheck those (opt-out). I don't this as this means it would be easy to not uncheck an option. It should be the other way around. You should have to check (opt-in) to the options that is required.

My database field is varchar(20) and yes that is enough as I am storing up to five options that are single letter.

Any thoughts on how to get Xataface to NOT auto check the checkboxes?

Thanks.

Jeremy

PostPosted: Tue Nov 17, 2009 10:36 am
by shannah
Hmm.. strange. I can't think of anything that would cause this off the top of my head. Can you post:

1. Xataface,PHP, MySQL, Server, OS version.
2. The valuelist definition.
3. The fields.ini field definition.
4. The MySQL table definition.

PostPosted: Tue Nov 17, 2009 11:59 am
by cyberws
Thanks for the feedback.

I solved this by removing the default value. I was assigning a default of "u" which meant unclassified. I did remove this when testing but it didn't change.

However when I switch my character set from latin1_swedish_ci to utf8_general_ci I noticed the checkboxes went unchecked with no default value. I then redefined a default value of "u" and boom ALL checkboxes where selected. However once again removing the default value didn't return unchecked checkboxes.

So I switch back to latin1_swedish_ci and that worked. I then redefined the character set as utf8_general_ci. Obviously Xataface isn't picking up the changes when a default value is dropped from a column.

For the record I am using Xataface 1.1.5 (I tried upgrading to 1.2.2 but go errors) on Redhat Enterprise Linux with PHP 5.2.9 running APC.

PostPosted: Tue Nov 17, 2009 12:17 pm
by shannah
I think it is the APC that is causing the grief. Xataface detects and uses APC if it is present, to cache things like the table schema and fields.ini files. If you change the table schema in any way, you may need to refresh the apc cache. You can do this by adding

--refresh-apc=1

to your URL.

(e.g. index.php?-action=foo&table=bar&--refresh-apc=1)

You can disable its use of APC altogether by adding the following to the beginning of your index.php file:

Code: Select all
define('DATAFACE_EXTENSION_LOADED_APC',false);

PostPosted: Tue Nov 17, 2009 12:37 pm
by cyberws
Yeah that is it. When I use the switch you provided I can cause the checkboxes to be all checked or unchecked by modifying the column's default value. Odd that change doesn't get reflected when other changes do.

However there you go. I hope it helps someone else out. I want APC on for sure.

Thank you!