New Record Error

A place for users and developers of the Xataface to discuss and receive support.

Postby zopemgr » Mon Apr 10, 2006 3:42 pm

When trying to enter a new record I get the below output. Clicking Reload on my browser yields a record updated ok message. Any ideas?


Notice: Array to string conversion in /usr/src/dataface/Dataface/Error.php on line 61

Notice: Array to string conversion in /usr/src/dataface/Dataface/Error.php on line 61

Notice: Array to string conversion in /usr/src/dataface/Dataface/Error.php on line 61

Notice: Array to string conversion in /usr/src/dataface/Dataface/Error.php on line 61

Notice: Array to string conversion in /usr/src/dataface/Dataface/Error.php on line 61

Notice: Array to string conversion in /usr/src/dataface/Dataface/Error.php on line 61

Notice: Array to string conversion in /usr/src/dataface/Dataface/Error.php on line 61

Notice: Attempt to set value for field '' in table 'employee' failed because the field does not exist.
On line 560 of file /usr/src/dataface/Dataface/Record.php in function printstacktrace()
On line 1807 of file /usr/src/dataface/Dataface/QuickForm.php in function setvalue(,0)
On line of file in function save(Array)
On line 1608 of file /usr/src/dataface/lib/HTML/QuickForm.php in function call_user_func(Array,Array)
On line 551 of file /usr/src/dataface/Dataface/TableView.php in function process(Array)
On line of file in function _browse_init()
On line 167 of file /usr/src/dataface/Dataface/TableView.php in function call_user_func(Array)
On line 441 of file /usr/src/dataface/Dataface/Application.php in function dataface_tableview(employee,Resource id #9,browse,Array,Array)
On line 20 of file /usr/local/www/data-dist/webmail/admiral/index.php in function display()
in /usr/src/dataface/Dataface/Record.php on line 560

Notice: Array to string conversion in /usr/src/dataface/Dataface/Error.php on line 61

Notice: Array to string conversion in /usr/src/dataface/Dataface/Error.php on line 61

Notice: Array to string conversion in /usr/src/dataface/Dataface/Error.php on line 61

Notice: Array to string conversion in /usr/src/dataface/Dataface/Error.php on line 61

Notice: Array to string conversion in /usr/src/dataface/Dataface/Error.php on line 61

Notice: Array to string conversion in /usr/src/dataface/Dataface/Error.php on line 61

Notice: Array to string conversion in /usr/src/dataface/Dataface/Error.php on line 61

Fatal error: [pear_error: message="2" code=0 mode=return level=notice prefix="" info="Field does not exist in table employee"]
On line 1339 of file /usr/src/dataface/Dataface/Table.php in function printstacktrace()
On line 1515 of file /usr/src/dataface/Dataface/Table.php in function getfield()
On line 1761 of file /usr/src/dataface/Dataface/Table.php in function gettype()
On line 562 of file /usr/src/dataface/Dataface/Record.php in function parse(,0)
On line 1807 of file /usr/src/dataface/Dataface/QuickForm.php in function setvalue(,0)
On line of file in function save(Array)
On line 1608 of file /usr/src/dataface/lib/HTML/QuickForm.php in function call_user_func(Array,Array)
On line 551 of file /usr/src/dataface/Dataface/TableView.php in function process(Array)
On line of file in function _browse_init()
On line 167 of file /usr/src/dataface/Dataface/TableView.php in function call_user_func(Array)
On line 441 of file /usr/src/dataface/Dataface/Application.php in function da in /usr/src/dataface/Dataface/Table.php on line 1339
zopemgr
 
Posts: 66
Joined: Wed Dec 31, 1969 5:00 pm

Postby shannah » Mon Apr 10, 2006 3:52 pm

Can you post the table definition and fields.ini file for the employee table?
--
Steve Hannah
@shannah78 (on twitter)
sjhannah.com blog
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Postby zopemgr » Mon Apr 10, 2006 4:26 pm

The fields.ini is below. I am unclear about the table definition. What do you want to see? Thanks!

[Social]
widget:label = "Social Security Number"
widget:description = "Enter social security number"

[Last]
widget:label = "Last Name"
widget:description = "Enter LAST name"

[First]
widget:label = "First Name"
widget:description = "Enter FIRST name"

[Middle]
widget:label = "Middle name"
widget:description = "Enter MIDDLE name or initial if found"

[Address1]
widget:label = "Address Line 1"
widget:description = "Enter street ADDRESS"

[Address2]
widget:label = "Address Line 2"
widget:description = "Enter suite or apartment if required"

[City]
widget:label = "City"
widget:autocomplete = cities

[State]
widget:label = "State"
widget:description = "Enter two letter state code"
widget:autocomplete = state

[Zip]
widget:label = "Zip Code"
widget:description = "Enter seven digit zip code"

[Phone1]
widget:label = "Home Phone"
widget:description = "Enter main phone number with area code"

[Phone2]
widget:label = "Cellular Phone"
widget:description = "Enter cellular phone number with area code"

[Phone3]
widget:label = "Other Phone"
widget:description = "Enter other phone number with area code"

[DriversLicense]
widget:label = "Driver's License"
widget:description = "Enter driver's license number"

[HireDate]
widget:label = "Date of Hire"
widget:description = "Enter date of first assignment"

[PayRate]
widget:label = "Hourly Pay"
widget:description = "Enter hourly rate of pay"

[Land]
widget:type = checkbox
widget:label = "Land Post Qualified"

[Maritime]
widget:type = checkbox
widget:label = "Maritme Post Qualified"

[Armed]
widget:type = checkbox
widget:label = "Armed Guard"

[NOC]
widget:type = checkbox
widget:label = "Armed New Orleans Commission"

[Comment]
widget:label = "Additional Comments"
zopemgr
 
Posts: 66
Joined: Wed Dec 31, 1969 5:00 pm

Postby shannah » Mon Apr 10, 2006 4:50 pm

>I am unclear about the table definition. What do you want to see?

Just want to see what fields are in the table and what type of fields they are. e.g.
Land VARCHAR(128),
Maritime TINYINT(1),

If you can give me a readout of the SQL to create the table that would have all the information. Otherwise just a list of the columns in the table and their associated types.

If you can send me that info it would be very helpful so that I can find out what the error is, and adjust future versions to give a more informative error message in those cases.
--
Steve Hannah
@shannah78 (on twitter)
sjhannah.com blog
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Postby zopemgr » Mon Apr 10, 2006 5:34 pm

Pardon my momentary ignorance, I was somehow thinking of dataface tables... Anyway, this is what you need?

Social int(9)
Last varchar(25)
First varchar(20)
Middle varchar(15)
Address1 varchar(25)
Address2 varchar(25)
City varchar(15)
State varchar(2)
Zip int(10)
Phone1 varchar(12)
Phone2 varchar(12)
Phone3 varchar(12)
DriversLicense int(20)
HireDate date Calendar
PayRate float
Land tinyint(1)
Maritime tinyint(1)
Armed tinyint(1)
NOC tinyint(1)
Comment text
zopemgr
 
Posts: 66
Joined: Wed Dec 31, 1969 5:00 pm

Postby shannah » Mon Apr 10, 2006 6:56 pm

Thanks for posting this.

You have uncovered an bug!

Dataface (incorrectly) assumes that all tables will have an auto-increment field. This table uses the SSN number as a primary key. My personal opinion is that it is not a good idea to use the SSN number for a primary key because this is sensitive information and should be "optional". There may also be times when the SSN is not available but you still need to insert a record. This is just my personal opinion and I am sure that there are probably exceptional cases where it is appropriate to use the SSN for a primary key.

Personal opinions aside, Dataface should be able to handle this case so it is a bug.

I have entered a bug report in the bug tracker at http://sourceforge.net/tracker/index.php?func=detail&aid=1468132&group_id=153729&atid=788932

I have also attached a fixed version of Dataface/QuickForm.php to the bug report that should fix this issue. Please let me know how it goes.
--
Steve Hannah
@shannah78 (on twitter)
sjhannah.com blog
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Postby zopemgr » Mon Apr 10, 2006 8:36 pm

Everything seems to work fine now. Thanks for the excellent repsonse!

On a personal note, I could spend hours raging the entire concept of the SSN as evil! Still, I must withhold money from paychecks and make sure credit is due at the IRS; hence, everybody in the US has a SSN on file with their employer.

Anyway, cool product, thanks!
zopemgr
 
Posts: 66
Joined: Wed Dec 31, 1969 5:00 pm

Postby amwassil » Fri Apr 14, 2006 2:13 pm

Thanks! I encountered this same problem. So I uploaded the fixed file. That resolved it.

Michael Wassil
amwassil
 
Posts: 30
Joined: Wed Dec 31, 1969 5:00 pm

Postby Aoirthoir » Thu Sep 21, 2006 2:28 pm

Mr. Steve,

I am assuming this issue is resolved with v0.6+? May I set it asside has being resolved?

Thank you kindly.
Aoirthoir
 
Posts: 420
Joined: Wed Dec 31, 1969 5:00 pm

Postby shannah » Thu Sep 21, 2006 2:39 pm

Yes.. resolved..

-Steve
--
Steve Hannah
@shannah78 (on twitter)
sjhannah.com blog
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 31 guests

cron
Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved