Re: Oracle autoincrement : PROBLEM
Hi Xanax Try this http://bakery.cakephp.org/articles/view/increment-behavior Saluos! On Sep 4, 8:30 am, Xanax mammer...@gmail.com wrote: Hi, I have a BIG problem. There is no autoincrement option in Oracle like in MySQL. Apparently, with CakePHP and Oracle, people use sequences and triggers to bypass this. My problem : I can't use triggers on my database, it's forbidden by my company. And of course i don't want to replace all the model-save() methods by their corresponding SQL request. Do you know what would be a good solution for me ? Thanks in advance --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: CKEditor in combination with images controller
Hi Marco I needed something like what you want. I decided to convert Encode Explorer on a Controller. And extend it to where I need it. http://encode-explorer.siineiolekala.net/ Saluos! On Sep 4, 8:40 am, Marco marco.lehman...@googlemail.com wrote: Hi guys, I'm wondering how I can combine CKEditor's image function with my own image controller, responsible for managing image upload and image detail data. My goal was to select from an image list provided by the image controller from inside CKEditor's image dialog. But maybe this is the wrong way. What would be the best practise? Thanks in advance. Marco --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: 500 Internal Server Error
Hi keyser_soze83 When I have trouble problems to install cakephp on a server, I use this method and never fails: 1.- Create an Alias on httpd.conf Alias /cakesite /home/user/public_html/cakesite 2.- Edit all .htaccess. Add: RewriteBase /cakesite after RewriteEngine on and before of Rewrite Rule Saluos! On Sep 4, 4:17 pm, keyser_soze83 frankdame...@gmail.com wrote: Dear co-developers, I know this problem keeps on appearing quite a few times on the groups, but anyway, after searching for a while, I did not found a solution yet. Hopefully you can help me out here because I'm getting desperate. I've developed some site with cakephp 1.2, but on the domain there were alread some blogs and photoalbums created in an earlier version of the site. They were all accessible at: blogname.domain.com Since I've installed cakephp for the new part of the site, these blogs and albums are not accessible any more. I get: Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, supp...@one.com and inform them of the time the error occurred, and anything you might have done that may have caused the error. More information about this error may be available in the server error log. I think I need to adjust the .htaccess file to allow accessibility on these sub-domains. It currently looks like this: IfModule mod_rewrite.c RewriteEngine on RewriteRule ^$ app/webroot/ [L] RewriteRule (.*) app/webroot/$1 [L] /IfModule Can someone tell me what to do? Thanks in advance Frank --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Problem with hasMany
hi brian, thanks for reply I made the changes you mentioned in the models and now the error is the same but in another line: Fatal error: Can not access empty property in / sitiotmp/www2/ nuevositio/cake/libs/model/model.php on line 948 I added lines before the 948 and got the DUMP 1 After this i add these lines: if(!isset($this-alias) || empty($this-alias)) { die('Es $this-alias'); } if(!isset($model) || empty($model)) { die('Is $this-{$model} = '. $model . ' on ' . $this-alias); } I got this response: Is $this-{$model} = on Contenido see something important? thanks again. /*/ DUMP 1 /**die(debug($this-alias)); **/ Grupos_de_contenido /die(debug($this-{$model}));/ Contenido Object ( [name] = Contenido [primaryKey] = id [displayField] = titulo [belongsTo] = Array ( [Grupos_de_contenido] = Array ( [className] = Grupos_de_contenido [foreignKey] = id_grupo_contenido [conditions] = [fields] = [order] = [counterCache] = ) ) [hasOne] = Array ( [Pagina] = Array ( [className] = Pagina [foreignKey] = id_contenido [conditions] = [fields] = [order] = [dependent] = ) ) [useDbConfig] = default [useTable] = contenidos [id] = [data] = Array ( ) [table] = contenidos [_schema] = Array ( [id] = Array ( [type] = integer [null] = [default] = [length] = 11 [key] = primary ) [id_grupo_contenido] = Array ( [type] = integer [null] = 1 [default] = [length] = 11 ) [id_contenido_padre] = Array ( [type] = integer [null] = 1 [default] = [length] = 11 ) [id_pagina] = Array ( [type] = integer [null] = 1 [default] = [length] = 11 ) [solo_enlace] = Array ( [type] = boolean [null] = [default] = [length] = 1 ) [titulo] = Array ( [type] = string [null] = 1 [default] = [length] = 255 ) [imagen] = Array ( [type] = string [null] = 1 [default] = [length] = 255 ) [url] = Array ( [type] = string [null] = 1 [default] = [length] = 255 ) [prioridad] = Array ( [type] = integer [null] = 1 [default] = [length] = 11 ) [publicado] = Array ( [type] = boolean [null] = 1 [default] = [length] = 1 ) ) [validate] = Array ( ) [validationErrors] = Array ( ) [tablePrefix] = [alias] = Contenido [tableToModel] = Array ( [contenidos] = Contenido [grupos_de_contenidos] = Grupos_de_contenido [paginas] = Pagina ) [logTransactions] = [transactional] = [cacheQueries] = [hasMany] = Array ( ) [hasAndBelongsToMany] = Array ( ) [actsAs] = [Behaviors] = BehaviorCollection Object ( [modelName] = Contenido [_attached] = Array ( ) [_disabled] = Array ( ) [__methods] = Array ( ) [__mappedMethods] = Array ( ) [_log] = ) [whitelist] = Array ( ) [cacheSources] = 1 [findQueryType] = [recursive] = 1 [order] = [__exists] = [__associationKeys] = Array (
Re: Problem with hasMany
Hi brian I solved the problem: if ($model != $this-alias !empty($model) isset($this- {$model})) { // Line 948 return $this-{$model}-getColumnType($column); } instead: if ($model != $this-alias isset($this-{$model})) { // Line 948 return $this-{$model}-getColumnType($column); } This in order to avoid running $this-{$ model} if $model is empty Thanks again! On Aug 31, 7:24 pm, brian bally.z...@gmail.com wrote: The only things that look odd are 'Prioridad' (should be lowercase?) and 'order'='ORDER BY RAND()'. I think that should be just 'order'='RAND()', but I could be wrong. Looking at line 21 of 8166, there are 2 properties that it may be failing on. I'd add these lines just above 921: die(debug($this-alias)); die(debug($this-{$model})); Run it once, then comment the 1st line. See if that shows anything helpful. On Mon, Aug 31, 2009 at 4:18 PM, logislackjhac...@gmail.com wrote: I have a problem with a hasMany relationship. Locally everything works fine, but when I upload files to the server I get the following error Fatal error: Cannot access empty property in /sitiotmp/www2/nuevositio/ cake/libs/model/model.php on line 921 I'm using cake 1.2.3.8166 My models with de problem: ?php class Grupos_de_contenido extends AppModel{ var $name = 'Grupos_de_contenido'; var $primaryKey = 'id'; var $displayField = 'nombre'; var $hasMany = array('Contenido'= array('className'='Contenido', 'foreignKey'='id_grupo_contenido', 'order'='Contenido.Prioridad DESC, Contenido.titulo ASC', 'conditions'='Contenido.publicado = true' )); } ? - ?php class Encuesta extends AppModel { var $name = 'Encuesta'; var $tableName = 'encuestas'; var $hasMany = array('Respuesta'=array ('className'='Respuesta', 'foreignKey'='id_encuesta')); function obtenerEncuesta($id = null) { $cond = array(); if(!is_null($id)) $cond = array('Encuesta.id' = $id); return $this-find('first', array('contidions'=$cond, 'order'='ORDER BY RAND()')); } } ? help? Thanks! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Problem with hasMany
If i only use die(debug($this-{$model})); I got the dump of object. If i only use die(debug($this-alias)); I got the Grupos_de_contenido It means what the error occurs is not in the first time what getColumnType function is called. Then the die(debug($this- {$model})); is killing the application before what the error occurs. function getColumnType($column) { $db = ConnectionManager::getDataSource($this-useDbConfig); $cols = $this-schema(); $model = null; $column = str_replace(array($db-startQuote, $db-endQuote), '', $column); if (strpos($column, '.')) { list($model, $column) = explode('.', $column); } if ($model != $this-alias !empty($model) isset($this- {$model})) { // Line 948 return $this-{$model}-getColumnType($column); } I Added the lines: if(!isset($model) || empty($model)) { die('Is $this-{$model} = '. $model . ' on ' . $this-alias); } to know what values are in the variables ($this-alias, $this- ($model)) when the error occurs. I got: Is $this-{$model} = on Contenido Only I create a new not empty condition for $model, before try $this- {$model} and all works fine. Thanks again. On Sep 1, 11:25 am, brian bally.z...@gmail.com wrote: I don't suggest that you modify the core files like that. It will lead to problems down the road when you want to upgrade. The hint to put the debug statements in there was just that--for debugging. It would be better to track down precisely what the problem is in your own code. The thing is, I'm having some trouble understanding what it is you did. if(!isset($this-alias) || empty($this-alias)) { die('Es $this-alias'); } if(!isset($model) || empty($model)) { die('Is $this-{$model} = '. $model . ' on ' . $this-alias); } Is $this-{$model} = on Contenido So, $model is empty. But, die(debug($this-{$model})); gives you a nice bunch of information. So, I'm confused. Maybe I'm not the best person to investigate this. One thing: Grupos_de_contenido should *maybe* be GruposDeContenido. I've no idea if it's related. On Tue, Sep 1, 2009 at 11:48 AM, logislackjhac...@gmail.com wrote: Hi brian I solved the problem: if ($model != $this-alias !empty($model) isset($this- {$model})) { // Line 948 return $this-{$model}-getColumnType($column); } instead: if ($model != $this-alias isset($this-{$model})) { // Line 948 return $this-{$model}-getColumnType($column); } This in order to avoid running $this-{$ model} if $model is empty Thanks again! On Aug 31, 7:24 pm, brian bally.z...@gmail.com wrote: The only things that look odd are 'Prioridad' (should be lowercase?) and 'order'='ORDER BY RAND()'. I think that should be just 'order'='RAND()', but I could be wrong. Looking at line 21 of 8166, there are 2 properties that it may be failing on. I'd add these lines just above 921: die(debug($this-alias)); die(debug($this-{$model})); Run it once, then comment the 1st line. See if that shows anything helpful. On Mon, Aug 31, 2009 at 4:18 PM, logislackjhac...@gmail.com wrote: I have a problem with a hasMany relationship. Locally everything works fine, but when I upload files to the server I get the following error Fatal error: Cannot access empty property in /sitiotmp/www2/nuevositio/ cake/libs/model/model.php on line 921 I'm using cake 1.2.3.8166 My models with de problem: ?php class Grupos_de_contenido extends AppModel{ var $name = 'Grupos_de_contenido'; var $primaryKey = 'id'; var $displayField = 'nombre'; var $hasMany = array('Contenido'= array('className'='Contenido', 'foreignKey'='id_grupo_contenido', 'order'='Contenido.Prioridad DESC, Contenido.titulo ASC', 'conditions'='Contenido.publicado = true' )); } ? - ?php class Encuesta extends AppModel { var $name = 'Encuesta'; var $tableName = 'encuestas'; var $hasMany = array('Respuesta'=array ('className'='Respuesta', 'foreignKey'='id_encuesta')); function obtenerEncuesta($id = null) { $cond = array(); if(!is_null($id)) $cond = array('Encuesta.id' = $id); return $this-find('first', array('contidions'=$cond, 'order'='ORDER BY RAND()')); } } ? help? Thanks! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to
Problem with hasMany
I have a problem with a hasMany relationship. Locally everything works fine, but when I upload files to the server I get the following error Fatal error: Cannot access empty property in /sitiotmp/www2/nuevositio/ cake/libs/model/model.php on line 921 I'm using cake 1.2.3.8166 My models with de problem: ?php class Grupos_de_contenido extends AppModel{ var $name = 'Grupos_de_contenido'; var $primaryKey = 'id'; var $displayField = 'nombre'; var $hasMany = array('Contenido'= array('className'='Contenido', 'foreignKey'='id_grupo_contenido', 'order'='Contenido.Prioridad DESC, Contenido.titulo ASC', 'conditions'='Contenido.publicado = true' )); } ? - ?php class Encuesta extends AppModel { var $name = 'Encuesta'; var $tableName = 'encuestas'; var $hasMany = array('Respuesta'=array ('className'='Respuesta', 'foreignKey'='id_encuesta')); function obtenerEncuesta($id = null) { $cond = array(); if(!is_null($id)) $cond = array('Encuesta.id' = $id); return $this-find('first', array('contidions'=$cond, 'order'='ORDER BY RAND()')); } } ? help? Thanks! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---