Load models without model files

2011-06-15 Thread qua...@gmail.com
Hi, I have tables that are created on the fly and I'd like to access it thru Model. Since those tables are dynamically created, I don't have the model .php files for them. The tables are created conforming to Cake's naming convention. I tried to use loadModel() to load them but Cake still complain

Re: apostrophe in URl and view cache

2011-03-18 Thread qua...@gmail.com
Thanks but I should have made it clear that I do urlencode the URL. I just didn't show the encoded URL here. On Mar 17, 4:46 pm, Ryan Schmidt wrote: > On Mar 17, 2011, at 13:24, qua...@gmail.com wrote: > > > I am having a problem with cache if the URL has apostrophe in it.

apostrophe in URl and view cache

2011-03-17 Thread qua...@gmail.com
Guys, I am having a problem with cache if the URL has apostrophe in it. For example: www.example.com/controller/action/What's My Name On first load when cache isn't there, it loads fine. However, once the cache is created, the subsequent load of the page causes PHP syntax error because in the ca

Re: Problem running shell in cronjob

2010-12-07 Thread qua...@gmail.com
e you linked to, and you already have > a wrapper script around the cake console, set the PATH within that wrapper > script. > > On Dec 7, 2010, at 13:23, qua...@gmail.com wrote: > > > I found out that I can fix the problem by calling php with its > > absolute path in

Re: Problem running shell in cronjob

2010-12-07 Thread qua...@gmail.com
at solution because it changes Cake core. Anyone any clue? Thanks! On Dec 6, 11:01 pm, "qua...@gmail.com" wrote: > Hi all, > > I followed the instructions > onhttp://book.cakephp.org/view/1110/Running-Shells-as-cronjobs > and I still ran into a strange problem while runnin

Re: Model->find('first', ...) returns false on error or empty result

2010-12-07 Thread qua...@gmail.com
be more constant if id behaved the same > > > > you could still check on if ($record = $this->find(...)) or $record > > > = ...; if (!empty($record)) etc > > > so the code wouldnt change at all for most people > > > as long as nobody used strict comparison yet, a

Re: Model->find('first', ...) returns false on error or empty result

2010-12-06 Thread qua...@gmail.com
ut this in your app_model.php: > >         /** >          * @return string Error message with error number >          */ >         public function lastError() { >                 $db = $this->getDataSource(); >                 return $db->lastError(); >         } > > if its not empty t

Problem running shell in cronjob

2010-12-06 Thread qua...@gmail.com
Hi all, I followed the instructions on http://book.cakephp.org/view/1110/Running-Shells-as-cronjobs and I still ran into a strange problem while running my shell in cronjob. I am getting error when I try to use model in the shell: Fatal error: Call to undefined function mysql_query() in /home/

Model->find('first', ...) returns false on error or empty result

2010-12-06 Thread qua...@gmail.com
Hi all, It appears Model->find('first', ...) returns false in both cases: 1) SQL error 2) Empty result How am I supposed to know which is which if it behaves this way? Thanks. Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You

Re: Custom helper in PagesController

2010-12-02 Thread qua...@gmail.com
I get this error in log: Undefined property: View::$Fxpage in [...] On Dec 2, 12:29 pm, "qua...@gmail.com" wrote: > Hi all, > > I have a custom helper and like to use it in Pages Controller. > > I copied pages_controller.php to my app and have this line in it: >

Custom helper in PagesController

2010-12-02 Thread qua...@gmail.com
Hi all, I have a custom helper and like to use it in Pages Controller. I copied pages_controller.php to my app and have this line in it: var $helpers = array('Html', 'Session', 'Fxpage'); However, the output of the pages stops at the call to any $this- >Fxpage in the layout file. It just seems

Re: CakePHP Model uses the wrong fields in SQL statements!

2010-11-29 Thread qua...@gmail.com
Just a little update from myself...ever since I converted the code to use custom query (model->query()), I have been processing millions of records like a knife cutting through butter. I do still want to hunt down this bug in any way I can. I will try to create a small test case if it is even poss

Re: CakePHP Model uses the wrong fields in SQL statements!

2010-11-22 Thread qua...@gmail.com
Wouldn't it be better to get a consistent set of > > data and run your code consistently against it - else how are you going to > > know for sure if you have isolated the root cause? > > > Jeremy Burns > > Class Outfit > > > jeremybu...@classoutfit.co

Re: CakePHP Model uses the wrong fields in SQL statements!

2010-11-22 Thread qua...@gmail.com
it be better to get a consistent set of > data and run your code consistently against it - else how are you going to > know for sure if you have isolated the root cause? > > Jeremy Burns > Class Outfit > > jeremybu...@classoutfit.comhttp://www.classoutfit.com > >

Re: CakePHP Model uses the wrong fields in SQL statements!

2010-11-22 Thread qua...@gmail.com
be repeatable. What else have you got either in > your code or elsewhere in your environment that is variable? > > Jeremy Burns > Class Outfit > > jeremybu...@classoutfit.comhttp://www.classoutfit.com > > On 22 Nov 2010, at 20:39, qua...@gmail.com wrote: > > > Empty

Re: CakePHP Model uses the wrong fields in SQL statements!

2010-11-22 Thread qua...@gmail.com
> > jeremybu...@classoutfit.comhttp://www.classoutfit.com > > On 22 Nov 2010, at 20:18, qua...@gmail.com wrote: > > > Here is all the code: > > $this->out("this->Album->field('Album.library_count')"); > > $this->Album->id = $album_id; > >

Re: CakePHP Model uses the wrong fields in SQL statements!

2010-11-22 Thread qua...@gmail.com
;field('Album.library_count'); > > (or is this code just an extraction?) > > Jeremy Burns > Class Outfit > > jeremybu...@classoutfit.comhttp://www.classoutfit.com > > On 22 Nov 2010, at 20:05, qua...@gmail.com wrote: > > > As I said before, I WANT this

Re: CakePHP Model uses the wrong fields in SQL statements!

2010-11-22 Thread qua...@gmail.com
causing this > - Examine my looping code using debug statements > - Strip the code down to the bone and gradually build back up until it breaks > > Jeremy Burns > Class Outfit > > jeremybu...@classoutfit.comhttp://www.classoutfit.com > > On 22 Nov 2010, at 19:20, qua...@gmai

Re: CakePHP Model uses the wrong fields in SQL statements!

2010-11-22 Thread qua...@gmail.com
obably will need to write custom queries myself instead of relying on Cake to do the right thing for me. On Nov 22, 10:35 am, "qua...@gmail.com" wrote: > I am gong to try with recursive = -1. > > Thanks. > > On Nov 22, 9:35 am, John Andersen wrote: > > >

Re: CakePHP Model uses the wrong fields in SQL statements!

2010-11-22 Thread qua...@gmail.com
ments, I still could > not see any erroneous SQL statement. All created statements looks like > this: > [code] > SELECT COUNT(*) AS `count` FROM `albums_songs` AS `AlbumSong` WHERE > `AlbumSong`.`album_id` = 3 AND `AlbumSong`.`song_id` = 4 > [/code] > &g

Re: CakePHP Model uses the wrong fields in SQL statements!

2010-11-22 Thread qua...@gmail.com
By the way, it is looking like this bug: http://cakephp.lighthouseapp.com/projects/42648/tickets/1069-occasional-rare-hard-to-trace-bug-sql-with-wrong-column-names-generated On Nov 21, 10:51 am, "qua...@gmail.com" wrote: > Here are model setup: > > models/album.php >

Re: CakePHP Model uses the wrong fields in SQL statements!

2010-11-21 Thread qua...@gmail.com
; => false, 'conditions' => '', 'fields' => '', 'order' => '', 'limit' => '', 'offset&#

Re: CakePHP Model uses the wrong fields in SQL statements!

2010-11-21 Thread qua...@gmail.com
`AlbumSong` WHERE `Song`.`name` = 'Garota de Ipanema' AND `Song`.`artist_id` = 5123 It makes no sense to me at all. I really want this to be MY mistake and not Cake's because I need to trust Cake in my projects. Please help. On Nov 19, 12:10 am, "qua...@gmail.com" wrote: > I a

Re: CakePHP Model uses the wrong fields in SQL statements!

2010-11-19 Thread qua...@gmail.com
ount` FROM `genres` AS `Genre` WHERE `Genre`.`id` = 273 Why? What would prompt Cake to execute that three 3 times in a row? I'm very frustrated at this point. I don't know how I can trust Cake to deal with my data anymore... On Nov 17, 9:36 am, "qua...@gmail.com" wrote: >

Re: Multiple REGEXP on same field in Find conditions

2010-11-17 Thread qua...@gmail.com
;), array('Artist.name NOT REGEXP' => "^Va$"), array('Artist.name NOT REGEXP' => "^No Artist"), array('Artist.name NOT REGEXP' => "^Varios"), array('Artist.name NOT REGEXP' => "^artist$") If they can be combine

Re: Multiple REGEXP on same field in Find conditions

2010-11-17 Thread qua...@gmail.com
Thanks. Array of array works! On Nov 17, 12:50 pm, euromark wrote: > http://www.dereuromark.de/2010/10/07/cakephp-beginner-tips/ > "find conditions" > > On 17 Nov., 21:12, "qua...@gmail.com" wrote: > > > Hi all, > > > I need to filter the

Multiple REGEXP on same field in Find conditions

2010-11-17 Thread qua...@gmail.com
Hi all, I need to filter the result based on a set of regular expressions. For example, I want to find a list of names that do not contain the word "various" and ".com". So I have: $this->find('all', array('conditions' => array('Artist.name NOT REGEXP' => "Various",

Re: CakePHP Model uses the wrong fields in SQL statements!

2010-11-17 Thread qua...@gmail.com
as consistently as you can, then > simplify to the bone, cut models, associations, etc. to narrow down. > If you can produce a simple testcase that fails, open a ticket in > lighthouse. > > On Nov 16, 8:45 pm, cricket wrote: > > > On Tue, Nov 16, 2010 at 1:37 PM, qua...@gmail

Re: CakePHP Model uses the wrong fields in SQL statements!

2010-11-16 Thread qua...@gmail.com
I do call Create() before any Save operation. You think I need to do that even for Read operation? Thanks. On Nov 16, 10:18 am, cricket wrote: > On Tue, Nov 16, 2010 at 12:50 PM, qua...@gmail.com wrote: > > Hi, > > > I have a bunch of models with various associations s

Re: CakePHP Model uses the wrong fields in SQL statements!

2010-11-16 Thread qua...@gmail.com
To me it seems just imposibile to > generate this. Something somewhere is certainly wrong. And I don't thing > cake is. Why not check the core ? > > For example try: recursive => -1 > See if happens again. > > Does this happens on every call ? > > > > On Tue,

CakePHP Model uses the wrong fields in SQL statements!

2010-11-16 Thread qua...@gmail.com
Hi, I have a bunch of models with various associations set up between them and seems like Cakephp at times executes incorrect SQL statement and cause MySQL to barf. Please refer the the "EDIT" followed by this to see some examples of the problem. It doesn't happen all the time but it eventually