Re: varchars as foreign keys in Cake leads to conversion to Int Error - using MS SQL

2012-11-14 Thread Tomas
actually, just bellow the red err message there is an SQL being triggeredthere is also table called 'die' (technical term :) which has same relations like 'material'. currently I have only die table filled, so materials sql does not go to collision I guess. SELECT [Dy].[ID] AS [Dy__ID], [Dy

FileUpload from Nick Baker, file required or data not saved

2012-11-14 Thread Shosho
My CakePHP 1.3 app uses FileUPload from Nick Baker, and it all works well, except that when I try and add a new study or edit one, if I don't choose a file, the data is lost and changes not saved. This is very frustrating, especially if I just want to change the inclusion or exclusion criteria or e

Re: varchars as foreign keys in Cake leads to conversion to Int Error - using MS SQL

2012-11-14 Thread Tomas
Reuben, thanks a lot for looking at this thing... the cake version I use is: 2.2.3 so I might try to use to convert it to nvarchar in MSSQL, would it help?? I will try to get the sql message from the driver - I will post it ASAP.But I will need to leave office now. Thank you, very appreciated

Re: varchars as foreign keys in Cake leads to conversion to Int Error - using MS SQL

2012-11-14 Thread Reuben
Actually, I had a bit more of a look around. The only thing that jumps out at me is that Cake/Model/Datasource/Database/Sqlserver.php doesn't have a mapping of VARCHAR to a string or text type. It only handles nvarchar. It's the DboSource::value that determines if the value should be quoted or

Re: varchars as foreign keys in Cake leads to conversion to Int Error - using MS SQL

2012-11-14 Thread Reuben
When a field is a foreign key on one table, there's an implication that it is a primary key on another table. And it is generally accepted convention that primary keys are ints, except when they aren't! [http://book.cakephp.org/1.3/view/1016/Using-UUIDs-as-Primary-Keys] Since a UUID is not an

varchars as foreign keys in Cake leads to conversion to Int Error - using MS SQL

2012-11-14 Thread Tomas
Hi!! I work ussualy with mysql and I work in cake long time, but now with MS SQL, I get strange error on very simple thing - *view*, *index*, *edit*methods within *SCAFFOLD mode.* * Error: *SQLSTATE[22018]: [Microsoft][SQL Server Native Client 11.0][SQL Server]Conversion failed when converting

Re: nginx and CakePHP

2012-11-14 Thread sophistry
look at this section: http://book.cakephp.org/2.0/en/core-libraries/components/security-component.html#using-per-session-tokens-instead-of-one-time-use-tokens you can turn off the "token" function of the csrf so you'll be able to submit the form twice. hth. On Tuesday, November 13, 2012 4:53:13

RE: nginx and CakePHP

2012-11-14 Thread Advantage+
Security component is running but why black hole it on the second try? And why URL not found when its found on the first form submit, comes back invalid user / pass please try again. Then it gets black-holed. When you try again.. Just seems odd that it only happens on second try. From: cake-p

Re: A somewhat interesting pagination problem

2012-11-14 Thread lowpass
If a view is out then I think you're best bet is to keep the DB records in the order you need and leave pagination to just limiting the number. Have a look at the SortableBehavior. Perhaps you could hack up a routine that ensures the records remain sorted properly even as new ones are added. On We

Re: How to set mapResources for all controllers?

2012-11-14 Thread lowpass
Router::mapResources( App::objects('Controller')); On Wed, Nov 14, 2012 at 6:26 AM, derwu22 wrote: > put name of every controller into argument of mapResources > > W dniu wtorek, 13 listopada 2012 20:12:34 UTC+1 użytkownik cricket napisał: >> >> What do you mean by "automatically"? Like in a conf

Re: How to use KoolPHP with CakePHP

2012-11-14 Thread Russell Brown
Thanks for your quick reply. I will definitely check out jqGrid. Another CakePHP developer also pointed out jQueryUI and really likes it but I haven't had a chance to really dig into it yet either. I will checkout using an array in Koolgrid too. I only looked at Query because the Koolgrid ex

Re: Interesting problem with pagination

2012-11-14 Thread polutan
your *image_portrait* not returned? is that you mean? 2012/11/14 char > Hi all, > > I've got a problem which I hope is interesting to everyone. > > Got a generic table, in which each item has an image and an attribute that > says wether the orientation is portriat or landscape. > > id int(10) u

Re: nginx and CakePHP

2012-11-14 Thread sophistry
can you determine the reason the request is being blackholed? http://book.cakephp.org/2.0/en/core-libraries/components/security-component.html On Tuesday, November 13, 2012 4:53:13 PM UTC-5, advantage+ wrote: > > I I finally have the site configured to run on nginx but I am getting a > weird err

Re: Yet another "Call to a member function find on a non-object" error

2012-11-14 Thread Andrew Johnston
I didn't post any code because any piece of code where I try to call a related model I get the error, but for example, here's one: $slides = $this->Module->Slide->find('all', array('conditions' => array('Module.id' => $id))); I've since changed the code to a poor workaround, so I'll change it b

Re: How to set mapResources for all controllers?

2012-11-14 Thread derwu22
put name of every controller into argument of mapResources W dniu wtorek, 13 listopada 2012 20:12:34 UTC+1 użytkownik cricket napisał: > > What do you mean by "automatically"? Like in a config file? > > On Tue, Nov 13, 2012 at 9:06 AM, derwu22 > > wrote: > > Anyone? > > > > W dniu poniedziałe