I'm not buying that, but here you go:
function view($id){
$this->set('user', $this->User->find($id));
}
>From the debug output, it appears that the uuid is being passed
intact, but the generated sql garbles the where clause. Just in case,
here is the "3" level debug output for the action:
Query: SELECT `User`.`id`, `User`.`username`, `User`.`password` FROM
`users` AS `User` WHERE 4796ed47-ec68-42d0-8b57-30402d55369f LIMIT 1
Warning (512): SQL Error: 1054: Unknown column '4796ed47' in 'where
clause' [CORE\cake\libs\model\datasources\dbo_source.php, line 440]
Code | Context
$sql = "SELECT `User`.`id`, `User`.`username`, `User`.`password` FROM
`users` AS `User` WHERE 4796ed47-ec68-42d0-8b57-30402d55369f LIMIT
1"
$error = "1054: Unknown column '4796ed47' in 'where clause'"
e("<p style = \"text-align:left\"><b>Query:</b> {$sql} ");
if ($error) {
trigger_error("<span style = \"color:Red;text-
align:left\"><b>SQL Error:</b> {$this->error}</span>",
E_USER_WARNING);
DboSource::showQuery() - CORE\cake\libs\model\datasources
\dbo_source.php, line 440
DboSource::execute() - CORE\cake\libs\model\datasources
\dbo_source.php, line 166
DboSource::fetchAll() - CORE\cake\libs\model\datasources
\dbo_source.php, line 297
DboSource::read() - CORE\cake\libs\model\datasources\dbo_source.php,
line 565
Model::find() - CORE\cake\libs\model\model.php, line 1752
UsersController::view() - APP\controllers\users_controller.php, line
11
Dispatcher::_invoke() - CORE\cake\dispatcher.php, line 268
Dispatcher::dispatch() - CORE\cake\dispatcher.php, line 240
[main] - APP\webroot\index.php, line 84
CakePHP: the rapid development php framework
User
Id
Username
Password
* List
CakePHP: the rapid development php framework
Controller dump:
UsersController Object
(
[name] => Users
[here] => /cake/cake_time/users/view/4796ed47-
ec68-42d0-8b57-30402d55369f
[webroot] => /cake/cake_time/
[action] => view
[uses] =>
[helpers] => Array
(
[0] => Html
[1] => Form
)
[params] => Array
(
[pass] => Array
(
[0] => 4796ed47-ec68-42d0-8b57-30402d55369f
)
[named] => Array
(
)
[controller] => users
[action] => view
[plugin] =>
[form] => Array
(
)
[url] => Array
(
[url] => users/view/4796ed47-
ec68-42d0-8b57-30402d55369f
)
[bare] => 0
[webservices] =>
[models] => Array
(
[0] => User
)
)
[data] =>
[paginate] => Array
(
[limit] => 20
[page] => 1
)
[viewPath] => users
[layoutPath] =>
[viewVars] => Array
(
[user] =>
[cakeDebug] => UsersController Object
*RECURSION*
)
[pageTitle] =>
[modelNames] => Array
(
[0] => User
)
[base] => /cake/cake_time
[layout] => default
[autoRender] =>
[autoLayout] => 1
[components] => Array
(
[0] => Session
)
[view] => View
[ext] => .ctp
[__viewClass] => View Object
(
[base] => /cake/cake_time
[here] => /cake/cake_time/users/view/4796ed47-
ec68-42d0-8b57-30402d55369f
[plugin] =>
[name] => Users
[action] => view
[params] => Array
(
[pass] => Array
(
[0] => 4796ed47-
ec68-42d0-8b57-30402d55369f
)
[named] => Array
(
)
[controller] => users
[action] => view
[plugin] =>
[form] => Array
(
)
[url] => Array
(
[url] => users/view/4796ed47-
ec68-42d0-8b57-30402d55369f
)
[bare] => 0
[webservices] =>
[models] => Array
(
[0] => User
)
)
[passedArgs] => Array
(
[0] => 4796ed47-ec68-42d0-8b57-30402d55369f
)
[data] =>
[helpers] => Array
(
[0] => Html
[1] => Form
)
[viewPath] => users
[viewVars] => Array
(
[user] =>
[cakeDebug] => UsersController Object
*RECURSION*
)
[layout] => default
[layoutPath] =>
[pageTitle] =>
[autoRender] => 1
[autoLayout] => 1
[ext] => .ctp
[subDir] =>
[themeWeb] =>
[cacheAction] =>
[validationErrors] => Array
(
)
[hasRendered] =>
[loaded] => Array
(
[html] => HtmlHelper Object
(
[tags] => Array
(
[meta] => <meta%s/>
[metalink] => <link href="%s"%s/>
[link] => <a href="%s"%s>%s</a>
[mailto] => <a href="mailto:%s" %s>
%s</a>
[form] => <form %s>
[formend] => </form>
[input] => <input name="%s" %s/>
[textarea] => <textarea name="%s"
%s>%s</textarea>
[hidden] => <input type="hidden"
name="%s" %s/>
[checkbox] => <input
type="checkbox" name="%s" %s/>
[checkboxmultiple] => <input
type="checkbox" name="%s[]"%s />
[radio] => <input type="radio"
name="%s" id="%s" %s />%s
[selectstart] => <select
name="%s"%s>
[selectmultiplestart] => <select
name="%s[]"%s>
[selectempty] => <option
value=""%s> </option>
[selectoption] => <option
value="%s"%s>%s</option>
[selectend] => </select>
[optiongroup] => <optgroup
label="%s"%s>
[optiongroupend] => </optgroup>
[checkboxmultiplestart] =>
[checkboxmultipleend] =>
[password] => <input
type="password" name="%s" %s/>
[file] => <input type="file"
name="%s" %s/>
[file_no_model] => <input
type="file" name="%s" %s/>
[submit] => <input type="submit"
%s/>
[submitimage] => <input
type="image" src="%s" %s/>
[button] => <input type="%s" %s/>
[image] => <img src="%s" %s/>
[tableheader] => <th%s>%s</th>
[tableheaderrow] => <tr%s>%s</tr>
[tablecell] => <td%s>%s</td>
[tablerow] => <tr%s>%s</tr>
[block] => <div%s>%s</div>
[blockstart] => <div%s>
[blockend] => </div>
[para] => <p%s>%s</p>
[parastart] => <p%s>
[label] => <label for="%s"%s>%s</
label>
[fieldset] => <fieldset><legend>
%s</legend>%s</fieldset>
[fieldsetstart] =>
<fieldset><legend>%s</legend>
[fieldsetend] => </fieldset>
[legend] => <legend>%s</legend>
[css] => <link rel="%s" type="text/
css" href="%s" %s/>
[style] => <style type="text/
css"%s>%s</style>
[charset] => <meta http-
equiv="Content-Type" content="text/html; charset=%s" />
[ul] => <ul%s>%s</ul>
[ol] => <ol%s>%s</ol>
[li] => <li%s>%s</li>
[error] => <div%s>%s</div>
)
[base] => /cake/cake_time
[here] => /cake/cake_time/users/view/
4796ed47-ec68-42d0-8b57-30402d55369f
[params] => Array
(
[pass] => Array
(
[0] => 4796ed47-
ec68-42d0-8b57-30402d55369f
)
[named] => Array
(
)
[controller] => users
[action] => view
[plugin] =>
[form] => Array
(
)
[url] => Array
(
[url] => users/view/
4796ed47-ec68-42d0-8b57-30402d55369f
)
[bare] => 0
[webservices] =>
[models] => Array
(
[0] => User
)
)
[action] => view
[data] =>
[_crumbs] => Array
(
)
[__docTypes] => Array
(
[html4-strict] => <!DOCTYPE HTML
PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/
strict.dtd">
[html4-trans] => <!DOCTYPE HTML
PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/
html4/loose.dtd">
[html4-frame] => <!DOCTYPE HTML
PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/
html4/frameset.dtd">
[xhtml-strict] => <!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/
DTD/xhtml1-strict.dtd">
[xhtml-trans] => <!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/
xhtml1/DTD/xhtml1-transitional.dtd">
[xhtml-frame] => <!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/
xhtml1/DTD/xhtml1-frameset.dtd">
[xhtml11] => <!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/
xhtml11.dtd">
)
[helpers] =>
[webroot] => /cake/cake_time/
[themeWeb] =>
[plugin] =>
[namedArgs] =>
[argSeparator] =>
[validationErrors] =>
[__tainted] =>
[__cleaned] =>
[_log] =>
)
[form] => FormHelper Object
(
[helpers] => Array
(
[0] => Html
)
[fieldset] => Array
(
[fields] => Array
(
)
[key] => id
[validates] => Array
(
)
)
[__options] => Array
(
[day] => Array
(
)
[minute] => Array
(
)
[hour] => Array
(
)
[month] => Array
(
)
[year] => Array
(
)
[meridian] => Array
(
)
)
[fields] => Array
(
)
[requestType] =>
[base] => /cake/cake_time
[webroot] => /cake/cake_time/
[themeWeb] =>
[here] => /cake/cake_time/users/view/
4796ed47-ec68-42d0-8b57-30402d55369f
[params] => Array
(
[pass] => Array
(
[0] => 4796ed47-
ec68-42d0-8b57-30402d55369f
)
[named] => Array
(
)
[controller] => users
[action] => view
[plugin] =>
[form] => Array
(
)
[url] => Array
(
[url] => users/view/
4796ed47-ec68-42d0-8b57-30402d55369f
)
[bare] => 0
[webservices] =>
[models] => Array
(
[0] => User
)
)
[action] => view
[plugin] =>
[data] =>
[namedArgs] =>
[argSeparator] =>
[validationErrors] =>
[tags] => Array
(
)
[__tainted] =>
[__cleaned] =>
[_log] =>
[Html] => HtmlHelper Object
(
[tags] => Array
(
[meta] => <meta%s/>
[metalink] => <link
href="%s"%s/>
[link] => <a href="%s"%s>
%s</a>
[mailto] => <a
href="mailto:%s" %s>%s</a>
[form] => <form %s>
[formend] => </form>
[input] => <input
name="%s" %s/>
[textarea] => <textarea
name="%s" %s>%s</textarea>
[hidden] => <input
type="hidden" name="%s" %s/>
[checkbox] => <input
type="checkbox" name="%s" %s/>
[checkboxmultiple] =>
<input type="checkbox" name="%s[]"%s />
[radio] => <input
type="radio" name="%s" id="%s" %s />%s
[selectstart] => <select
name="%s"%s>
[selectmultiplestart] =>
<select name="%s[]"%s>
[selectempty] => <option
value=""%s> </option>
[selectoption] => <option
value="%s"%s>%s</option>
[selectend] => </select>
[optiongroup] => <optgroup
label="%s"%s>
[optiongroupend] => </
optgroup>
[checkboxmultiplestart]
=>
[checkboxmultipleend] =>
[password] => <input
type="password" name="%s" %s/>
[file] => <input
type="file" name="%s" %s/>
[file_no_model] => <input
type="file" name="%s" %s/>
[submit] => <input
type="submit" %s/>
[submitimage] => <input
type="image" src="%s" %s/>
[button] => <input
type="%s" %s/>
[image] => <img src="%s"
%s/>
[tableheader] => <th%s>%s</
th>
[tableheaderrow] => <tr%s>
%s</tr>
[tablecell] => <td%s>%s</
td>
[tablerow] => <tr%s>%s</
tr>
[block] => <div%s>%s</div>
[blockstart] => <div%s>
[blockend] => </div>
[para] => <p%s>%s</p>
[parastart] => <p%s>
[label] => <label
for="%s"%s>%s</label>
[fieldset] =>
<fieldset><legend>%s</legend>%s</fieldset>
[fieldsetstart] =>
<fieldset><legend>%s</legend>
[fieldsetend] => </
fieldset>
[legend] => <legend>%s</
legend>
[css] => <link rel="%s"
type="text/css" href="%s" %s/>
[style] => <style
type="text/css"%s>%s</style>
[charset] => <meta http-
equiv="Content-Type" content="text/html; charset=%s" />
[ul] => <ul%s>%s</ul>
[ol] => <ol%s>%s</ol>
[li] => <li%s>%s</li>
[error] => <div%s>%s</div>
)
[base] => /cake/cake_time
[here] => /cake/cake_time/users/
view/4796ed47-ec68-42d0-8b57-30402d55369f
[params] => Array
(
[pass] => Array
(
[0] => 4796ed47-
ec68-42d0-8b57-30402d55369f
)
[named] => Array
(
)
[controller] => users
[action] => view
[plugin] =>
[form] => Array
(
)
[url] => Array
(
[url] => users/
view/4796ed47-ec68-42d0-8b57-30402d55369f
)
[bare] => 0
[webservices] =>
[models] => Array
(
[0] => User
)
)
[action] => view
[data] =>
[_crumbs] => Array
(
)
[__docTypes] => Array
(
[html4-strict] => <!
DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/
html4/strict.dtd">
[html4-trans] => <!DOCTYPE
HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://
www.w3.org/TR/html4/loose.dtd">
[html4-frame] => <!DOCTYPE
HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/
html4/frameset.dtd">
[xhtml-strict] => <!
DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://
www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
[xhtml-trans] => <!DOCTYPE
html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://
www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
[xhtml-frame] => <!DOCTYPE
html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/
xhtml1/DTD/xhtml1-frameset.dtd">
[xhtml11] => <!DOCTYPE
html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/
DTD/xhtml11.dtd">
)
[helpers] =>
[webroot] => /cake/cake_time/
[themeWeb] =>
[plugin] =>
[namedArgs] =>
[argSeparator] =>
[validationErrors] =>
[__tainted] =>
[__cleaned] =>
[_log] =>
)
)
[session] => SessionHelper Object
(
[helpers] =>
[__active] => 1
[valid] =>
[error] =>
[_userAgent] =>
8443614ede9110c387754e7b64103530
[path] =>
[lastError] =>
[security] =>
[time] => 1201076568
[sessionTime] =>
[watchKeys] => Array
(
)
[id] =>
[_log] =>
[base] => /cake/cake_time
[webroot] => /cake/cake_time/
[here] => /cake/cake_time/users/view/
4796ed47-ec68-42d0-8b57-30402d55369f
[params] => Array
(
[pass] => Array
(
[0] => 4796ed47-
ec68-42d0-8b57-30402d55369f
)
[named] => Array
(
)
[controller] => users
[action] => view
[plugin] =>
[form] => Array
(
)
[url] => Array
(
[url] => users/view/
4796ed47-ec68-42d0-8b57-30402d55369f
)
[bare] => 0
[webservices] =>
[models] => Array
(
[0] => User
)
)
[action] => view
[data] =>
[themeWeb] =>
[plugin] =>
)
)
[modelScope] =>
[model] =>
[association] =>
[field] =>
[fieldSuffix] =>
[modelId] =>
[uuids] => Array
(
)
[__passedVars] => Array
(
[0] => viewVars
[1] => action
[2] => autoLayout
[3] => autoRender
[4] => ext
[5] => base
[6] => webroot
[7] => helpers
[8] => here
[9] => layout
[10] => name
[11] => pageTitle
[12] => layoutPath
[13] => viewPath
[14] => params
[15] => data
[16] => webservices
[17] => plugin
[18] => passedArgs
[19] => cacheAction
)
[__scripts] => Array
(
)
[__paths] => Array
(
[0] => C:\www\wamp\www\cake\cake_time\views\
[1] => C:\www\wamp\www\cake\cake\libs\view\
)
[_log] =>
[webroot] => /cake/cake_time/
[webservices] =>
)
[output] =>
[plugin] =>
[cacheAction] =>
[persistModel] =>
[webservices] =>
[passedArgs] => Array
(
[0] => 4796ed47-ec68-42d0-8b57-30402d55369f
)
[_log] =>
[modelClass] => User
[modelKey] => user
[Session] => SessionComponent Object
(
[__active] => 1
[__started] => 1
[__bare] => 0
[valid] => 1
[error] =>
[_userAgent] => 8443614ede9110c387754e7b64103530
[path] => /cake/cake_time/
[lastError] =>
[security] => high
[time] => 1201076568
[sessionTime] => 1201077768
[watchKeys] => Array
(
)
[id] =>
[_log] =>
[host] => localhost
[cookieLifeTime] => 0
)
[User] => User Object
(
[name] => User
[validate] => Array
(
[username] => /^[\w\d]{8,20}$/
[password] => /^[\S]{8,20}$/
)
[useDbConfig] => default
[useTable] => users
[displayField] => id
[id] => 4796ed47-ec68-42d0-8b57-30402d55369f
[data] => Array
(
)
[table] => users
[primaryKey] => id
[_schema] => Array
(
[id] => Array
(
[type] => string
[null] =>
[default] =>
[length] => 36
[key] => primary
)
[username] => Array
(
[type] => string
[null] =>
[default] =>
[length] => 20
[key] => unique
)
[password] => Array
(
[type] => string
[null] =>
[default] =>
[length] => 40
)
)
[validationErrors] => Array
(
)
[tablePrefix] =>
[alias] => User
[tableToModel] => Array
(
[users] => User
)
[logTransactions] =>
[transactional] =>
[cacheQueries] =>
[belongsTo] => Array
(
)
[hasOne] => Array
(
)
[hasMany] => Array
(
)
[hasAndBelongsToMany] => Array
(
)
[actsAs] =>
[behaviors] => Array
(
)
[whitelist] => Array
(
)
[cacheSources] => 1
[findQueryType] =>
[__behaviorMethods] => Array
(
)
[recursive] => 1
[order] =>
[__exists] =>
[__associationKeys] => Array
(
[belongsTo] => Array
(
[0] => className
[1] => foreignKey
[2] => conditions
[3] => fields
[4] => order
[5] => counterCache
)
[hasOne] => Array
(
[0] => className
[1] => foreignKey
[2] => conditions
[3] => fields
[4] => order
[5] => dependent
)
[hasMany] => Array
(
[0] => className
[1] => foreignKey
[2] => conditions
[3] => fields
[4] => order
[5] => limit
[6] => offset
[7] => dependent
[8] => exclusive
[9] => finderQuery
[10] => counterQuery
)
[hasAndBelongsToMany] => Array
(
[0] => className
[1] => joinTable
[2] => with
[3] => foreignKey
[4] => associationForeignKey
[5] => conditions
[6] => fields
[7] => order
[8] => limit
[9] => offset
[10] => unique
[11] => finderQuery
[12] => deleteQuery
[13] => insertQuery
)
)
[__associations] => Array
(
[0] => belongsTo
[1] => hasOne
[2] => hasMany
[3] => hasAndBelongsToMany
)
[__backAssociation] => Array
(
)
[__insertID] =>
[__numRows] =>
[__affectedRows] =>
[__findMethods] => Array
(
[all] => 1
[first] => 1
[count] => 1
[neighbors] => 1
[list] => 1
)
[_log] =>
)
)
1 query took 1 ms Nr Query Error Affected Num. rows Took
(ms)
1 SELECT `User`.`id`, `User`.`username`, `User`.`password` FROM
`users` AS `User` WHERE 4796ed47-ec68-42d0-8b57-30402d55369f LIMIT 1
1054: Unknown column '4796ed47' in 'where clause' 1
On Jan 23, 4:34 am, "Dardo Sordi Bogado" <[EMAIL PROTECTED]> wrote:
> It seems like there is a problem in your controller, rather than in
> the FormHelper. Could you paste the view function ?
>
> On Jan 23, 2008 6:38 AM, rogwei <[EMAIL PROTECTED]> wrote:
>
>
>
> > I have a db table that happens to have both uuid and int values in the
> > id column. The following code works for the int value but not the uuid
> > values.
>
> > <?php echo $html->link('View',array('action'=>'view', $user['User']
> > ['id'])); ?>
>
> > Here is the generated sql and error:
>
> > Query: SELECT `User`.`id`, `User`.`username`, `User`.`password` FROM
> > `users` AS `User` WHERE 4796ed47-ec68-42d0-8b57-30402d55369f LIMIT 1
>
> > Warning (512): SQL Error: 1054: Unknown column '4796ed47' in 'where
> > clause' [CORE\cake\libs\model\datasources\dbo_source.php, line 440]
>
> > I cannot find anything in trac about this. Is this a bug or pilot
> > error?
>
> > Regards,
> > Roger
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---
