Page 1 of 1

PostPosted: Mon Jun 05, 2006 12:41 pm
by dst01
Hi first thanks for a great appliaction!

Now i went over all my settings and i still cannot make the valuelists work? I have my fields.ini file configured as well as my valuelists.ini file. Below is the content of both were they are stored in /var/www/html/sysadminappl/tables/apps
[root@localhost apps]# ls
fields.ini valuelists.ini

here is valuelists.ini
[list]
APP1 = Application1
APP2 = Application2
APP3 = Application3

here is fields.ini
[Applications]
widget:type = select
vocabulary = list

PostPosted: Mon Jun 05, 2006 1:25 pm
by njw
Have you tried using a different valuelist name than "list"? "List" could easily be a reserved word - try "Apps" or "qwerty" or something.

Neil

PostPosted: Mon Jun 05, 2006 2:40 pm
by shannah
Good idea to try Neil's suggestion about the name. I can't think of any reason why the name 'list' would be a problem, but this would be a good thing to try.

Alternatively, some questions:

1. I'm assuming that the name of your table is 'apps'. Correct?
2. The field in the 'apps' table is named 'Applications'. Correct? (Case sensitive).

Last thing I can think of is make sure that both your valuelists.ini and fields.ini files are readable by the webserver (i.e. make sure they are at least 0644).

Also double check to make sure that your fields.ini file is getting picked up. Try changing the labels on some fields to make sure that that works.

Hope this helps.

-Steve

PostPosted: Tue Jun 06, 2006 9:16 am
by dst01
njw,

yes i tried names other than list.

Steve,

1. yes my table is called apps.
2. yes the field is Applications correct.

i went over everything so many times, there must be an error somewhere. I have since created another db and followed your guide for the Program and Courses etc and that valuelist works, so it not a webserver readable issue.

let me compare and i will get back here.

PostPosted: Tue Jun 06, 2006 5:44 pm
by dleffler
It appears that things break in Table.php in line 716 (for me anyway). I haven't been able to track down WHY it defaults to "__import__" as if the list is coming straight from a table since it should default to the last else clause.

PostPosted: Tue Jun 06, 2006 7:51 pm
by shannah
This is very strange. That would indicate that you have an entry in your valuelists.ini file for '__import__'.

What version of PHP are you running?

A fix that should not be necessary is to use absolute equality. i.e. Change the '==' to '==='.

PostPosted: Tue Jun 06, 2006 8:40 pm
by dleffler
PHP 4.3.10 Actually, it was as simple as

vocabulary = YesNo

[YesNo]
0 = No
1 = Yes

I would get a for...each error printed at the top of the page for every list I had and the actual list would only have the "Please Select" and "Yes" as options.

I've since created a YesNo table and do a __sql__ since I get the same error with __import__ (not sure how it works anyway without documentation)

PostPosted: Tue Jun 06, 2006 9:07 pm
by shannah
OK.. this is quite strange. I'm inclined to think that there may be a problem with your PHP install. If you post your fields.ini file and valuelists.ini file I can take a look though to see if anything sticks out. Also if you want to see what's going on, try adding a print_r inside the if statement to see what data it's choking on. e.g.:

Code: Select all
if ( $key == '__import__' ){


becomes

Code: Select all
if ( $key == '__import__' ){
  print_r($vllist);


and let me know what the output is.

PostPosted: Thu Jun 08, 2006 9:22 am
by dst01
with the FacultyOfWidgetry site and db i setup the valuelist works, with my own site and db the valuelist does not work.

So based on what was discussed above my php install would be ok.

im going to try the print_r

valuelists problem

PostPosted: Tue Nov 27, 2007 7:51 am
by Jean
Hello,
I thought I would find the solution but no. I have the same problem with this valuelists.ini :

Code: Select all
[select_OUI]
0 = Non
1 = Oui


I thing there is a problem with numbers.
Jean

PostPosted: Tue Nov 27, 2007 3:54 pm
by shannah
Unfortunately INI files have the limitation that you cannot use:
Note: There are reserved words which must not be used as keys for ini files. These include: null, yes, no, true, and false. Values null, no and false results in "", yes and true results in "1". Characters {}|&~![()" must not be used anywhere in the key and have a special meaning in the value.

from: http://ca3.php.net/parse_ini_file

This appears to cause problems with the 0 key also.

One way around this is to move your valuelist into the database and change the valuelist definition to:
Code: Select all
[valuelistname]
    __sql__ "select ..."


-Steve

PostPosted: Tue Nov 27, 2007 3:58 pm
by Jean
Thank you Steve, that is what have done, eventually.
Jean

PostPosted: Sun Aug 17, 2008 10:59 am
by GrosBedo
Sorry to bump this old thread, but I had exactly the same problem.
I tried to use an enum, but the valuelists.ini won't be used as a dictionnary. I tried to change name and tweak the table. The only way I had to resolve it was to change the type of the field from ENUM to VARCHAR.

It seems that when using an ENUM, it will override any configuration you can put in a dctionnary in valuelists.ini

PostPosted: Mon Aug 18, 2008 9:39 am
by shannah
Thanks for reminding me about this one. It is a simple fix that I shall have to incorporate into the next release.

In the Dataface/Table.php file, find the line that says:
Code: Select all
if ( preg_match('/^(enum|set)\(([^\)]+)\)$/', $row['Type'], $matches )){


Change it to:
Code: Select all
if ( !$row['vocabulary'] and preg_match('/^(enum|set)\(([^\)]+)\)$/', $row['Type'], $matches )){


-Steve