My site is using Symfony 1.4.1 with Propel and a database running on
Microsoft SQL 2008.

I'm using a form class defined  in /lib/form to allow users to view
and edit rows in a table.  I've added a use_fields() line to it to
limit what shows up and changed one of the fields to use a checkbox
widget.

In my routing.yaml I have the following lines:

client:
  class:   sfPropelRouteCollection
  options: { model: Client, column: ID }


Calling /frontend_dev.php/modulename/25/edit.html correctly loads the
form with data form record with ID #25.  When I hit submit however I
get this error:

[wrapped: SQLSTATE[22018]: Invalid character value for cast
specification: 206 [Microsoft][ODBC SQL Server Driver][SQL
Server]Operand type clash: text is incompatible with bigint
(SQLExecute[206] at ext\pdo_odbc\odbc_stmt.c:133)]

I dug into the problem a bit, and it appears that some queries are
being issued that look like this [....] WHERE ID = '25'.  ID is a
bigint field (and is defined as such in schema.yml:

 ID: { phpName: Id, type: BIGINT, size: '8', scale: '0', primaryKey:
true, required: true }

The superficial cause of the problem appears to be that the propel
Criteria class binds the incoming ID parameter to the query as a
string.  I notice this is the default type when using
PDOStatement::bindParam() (not sure if that's relevant.  I'm not sure
why this is happening though.

I'm going to continue to dig, but wanted to find out if this was a
known problem, or if there are configuration settings I should be
looking at.

Additional note:

One thing I've  noticed is changes caused by the capitalization of the
column: field.  If I change it to column: Id to match the
capitalization of the phpname I get no errors, but everything always
defaults to loading record #1.  (/frontend_dev.php/modulename/25/
edit.hml loads record 1 not 25).

-- 
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-us...@googlegroups.com.
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en.

Reply via email to