Re: Cakephp 3.x patchEntity set "'new' => true" to entity in edit function

2016-04-25 Thread heavyKevy
Thanks for the update, I am glad to hear that it is working for you. It seems to me that in order for the system to know which record is being updated, that all of the ids should need to be supplied for every record that is being saved in a transaction. If it is saving a record for which you

Re: Cakephp 3.x patchEntity set "'new' => true" to entity in edit function

2016-04-20 Thread heavyKevy
I am not sure why the others appear to be working, I suggest that you test thoroughly to make sure they are doing as expected. It may be because of the many - to -one relationship though. Let me know how it goes. Regards, Kevin -- Sign up for our Newsletter for updates.

Re: Cakephp 3.x patchEntity set "'new' => true" to entity in edit function

2016-04-19 Thread heavyKevy
Does your edit form have an input for the address_id? something like:"user.addresses.0.id" I see the id: (29) for the address in the debug output of the entity... If you need further help with it, you are going to need to show the edit form in order to figure out what may be missing. Hope

Cakephp 3.x patchEntity set "'new' => true" to entity in edit function

2016-04-18 Thread heavyKevy
First off you don't need to cotain users 3 times, Users.Addresses.Countries includes all 3 tables already. Secondly, if the address has the id, it should automatically detect that it is being edited, if the id is missing it will add the address. -- Sign up for our Newsletter for updates.

In Cake 3 Is there a way to get find('list') to work when containing a related table?

2016-04-07 Thread heavyKevy
e.g. I have Countries and states each having an Id, abbreviation and name field. And State contaning the country_id. I would like to filter the states by country_abbreviation as follows: public function getListByCountryAbb($abb, $options = []){ $qry = $this->find('list',

Re: How can I get the user firstname displayed, instead of the User_id

2016-04-05 Thread heavyKevy
How many tables do you have? And if a first name is a property of a user, why would you put it in the profiles table and not in the users? Which version of Cake are you using? If I understand you correctly, you are saying you have a user that has a profile and a user has many proposals. If that

Re: [Cakephp 3.2.5] Cannot match provided foreignKey

2016-03-25 Thread heavyKevy
> > In addition to the other reply, i recommend that you use the bake utility > to bake your models so that all of the needed files are created along with > the correct syntax. > from a dos command prompt, cd to your application folder that contains your bin and src folders and issue the

Re: CakePHP 3 + MSSQL = slow query

2016-03-25 Thread heavyKevy
Is there any reason you are not paging it and fetching only 20, or 50 or 100 records at a time? That would significantly speed things up for you... Regards, --Kevin -- Sign up for our Newsletter for updates. http://cakephp.org/newsletter/signup We will soon be closing this Google Group. But

Re: Storing encrypted value using getter/setter not working. Stored in plain text.

2016-03-16 Thread heavyKevy
I hate to state the obvious, but did you verify that the field size was large enough to store the encrypted value? I had a similar issue with hashing a password, the field wasn't large enough and the value was saved but cut off so that the password never matched. Maybe try it with the max

Re: What is the meaning of this error in cakephp 3?

2016-03-12 Thread heavyKevy
You also need to make sure that you add the following line near the top of the file after the namespace with the other use statements: use Cake\Event\Event; Best regards, --Kevin On Sunday, March 13, 2016 at 1:47:10 AM UTC+7, Clement Crownrise wrote: > > Hi, Thanks Willem, > > I have tried

Is the automatic direction change broken in the paginator for the latest Cake 3 release?

2015-12-11 Thread heavyKevy
my index method has the following baked code. $this->paginate = [ 'contain' => ['Users', 'Heights', 'Weights', 'Bats', 'Throws', 'PrimaryPositions', 'SecondaryPositions'] ]; $this->set ( 'players', $this->paginate ( $this->Players ) ); And my index.ctp is the standard

Can someone please help with the syntax necessary to create the following query in Cake 3

2015-12-11 Thread heavyKevy
This is the target query: SELECT Players.id AS `Players__id`, Players.user_id AS `Players__user_id`, Players.opt_out AS `Players__opt_out`, Users.email AS `Users__email`, Users.first_name AS `Users__first_name`, s.searches AS `Players__search_count`, v.views AS `view_count`,

Re: Is the automatic direction change broken in the paginator for the latest Cake 3 release?

2015-12-11 Thread heavyKevy
Upon further examination, it works correctly for users, but fails for players On Saturday, December 12, 2015 at 4:08:21 AM UTC+7, heavyKevy wrote: > > Sorry, I just updated to the latest 3.1.5, > > here is an example link: > http://127.0.0.1/baseball/players/search?sort=wei

Re: Is the automatic direction change broken in the paginator for the latest Cake 3 release?

2015-12-11 Thread heavyKevy
re there any links outputted at all? > What do they say? > You need to be more exact in your statements, or it is hard to say > anything here. > > mark > > > > Am Freitag, 11. Dezember 2015 12:09:45 UTC+1 schrieb heavyKevy: >> >> my index method has the f

Re: Is the automatic direction change broken in the paginator for the latest Cake 3 release?

2015-12-11 Thread heavyKevy
I debugged it and discovered that sort options must be white listed if they are not part of the model. I missed that in the documentation... On Saturday, December 12, 2015 at 4:37:26 AM UTC+7, heavyKevy wrote: > > Upon further examination, it works correctly for users, but fails for >

Re: Can someone please help with the syntax necessary to create the following query in Cake 3

2015-12-11 Thread heavyKevy
able' => $ViewCount, 'type' => 'LEFT', 'conditions'=> ['v.player_id = Players.id']], 'p' => ['table' => $ProspectCount, 'type' => 'LEFT', 'conditions'=> ['p.player_id = Players.id']] and it is now working. On Friday, December 11, 2015 at 8:43:16 PM

Re: Advice on menu setup

2015-10-20 Thread heavyKevy
Is the menu supposed to be displayed on every page? I gather that the menu is dynamically driven by data in the Db... That tells me that you should have a model for it. If it is to be included on every page, then I would load the menu model in the App Controller, probably in the beforeRender()

Re: Looking for a CakePHP Tutor with some help with MVC project

2015-10-15 Thread heavyKevy
Corey, I am be willing to help. Let me know what help/assistance you need. Regards, --Kevin On Thursday, October 15, 2015 at 3:45:06 AM UTC+7, LSRX4EVER wrote: > > Hello, > > I am currently working on an internship web application that is utilizing > CakePHP. Currently I have a very large

Re: How do I get Cake 3.1 to reply to an AJAX request without requiring a layout .ctp file?

2015-10-15 Thread heavyKevy
:24 PM UTC+7, heavyKevy wrote: > > I have gone through the documentation, which is a bit too vague, and tried > many things, but I still am getting an error that the template file is > missing. > > I had this working sending back a json response in 3.0 using ext='json', >

How do I get Cake 3.1 to reply to an AJAX request without requiring a layout .ctp file?

2015-10-14 Thread heavyKevy
I have gone through the documentation, which is a bit too vague, and tried many things, but I still am getting an error that the template file is missing. I had this working sending back a json response in 3.0 using ext='json', yet after updating to 3.1 it is broken. I checked the migration

Re: How do I get Cake 3.1 to reply to an AJAX request without requiring a layout .ctp file?

2015-10-14 Thread heavyKevy
no longer get the action missing error. I still get the template missing error though. On Wednesday, October 14, 2015 at 2:02:24 PM UTC+7, heavyKevy wrote: > > I have gone through the documentation, which is a bit too vague, and tried > many things, but I still am getting an error that the

Re: baking a model of users

2015-09-06 Thread heavyKevy
According to cake convention the primary key of any table should be namd id. Foreign keys consist of a singular table name with _id appended. Rename your primary key to id and bake again and it should work as expected. -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter

Editor for Cakephp

2015-06-24 Thread heavyKevy
Eclipse is a resource hog, but it can be configured to use .ctp files as php files and can be configured for use with xdebug such that you can step through your code. it can also be incorporated with svn and can be configured to provide code completion. Also it supports code folding. -- Like

Re: Where to create common functionalities with view in cakephp?

2015-05-04 Thread heavyKevy
As Lorenzo mentioned you may need to use a plugin and in that it is included in most pages, you will likely need to put the code in an element. If it is simple, you may want to just load/use the model(s)/table(s) required in your app controller and use the element where needed to show your

Re: Still having trouble with saving BelongsToMany data

2015-03-13 Thread heavyKevy
I believe that is your answer you were looking for... I missed it too. Thanks Jose for pointing that one out. -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups

Re: Still having trouble with saving BelongsToMany data

2015-03-12 Thread heavyKevy
Joe, I tried doing a composer update and test and it is not broken for me. https://www.dropbox.com/s/7tjqy3i5z9hnngc/src.zip?dl=0 This is all of the source that I threw together to get it to work. The example is far from perfect in that I don't have all of the fields that you have in my

Re: Still having trouble with saving BelongsToMany data

2015-03-07 Thread heavyKevy
Joe, Maybe I suggested the wrong validation... The point is that when presenting the data, it will be looked at as an edit, but your create validation ensured that all fields were filled as required. For that reason, you should be able to set your update validation to not require any of those

Re: Still having trouble with saving BelongsToMany data

2015-03-07 Thread heavyKevy
I thought of one more option... You can specify a separate validation specifically for adding the listing attributes such that the usual validation continues to be used and work as it was and the new validation works only for this instance. The documentation has all of the information on how

Re: Still having trouble with saving BelongsToMany data

2015-03-07 Thread heavyKevy
Instead of allowEmpty, change the requirePresence as follows: -requirePresence('field_name', 'create') I believe that will accomplish what you want. -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you

Re: Still having trouble with saving BelongsToMany data

2015-03-06 Thread heavyKevy
Joe, I wasn't saying to remove all validation, but to add the method that allows you to not specify a value for the field. -allowEmpty('name','update') -allowEmpty('requires_value','update') -allowEmpty('acttive','update') If you add these lines to your

Re: Still having trouble with saving BelongsToMany data

2015-03-05 Thread heavyKevy
It seems to me that what you are missing now is altering your attributes validation to not require those fields with errors for update. In that the id is present, and you are getting validation errors it has to be trying to validate an update, alter your validation and you should be good to

Re: Still having trouble with saving BelongsToMany data

2015-03-04 Thread heavyKevy
Joe, did you make sure that you modified all of the files I mentioned? As I mentioned, it works for me allowing me to add with the join data. would it help if I zipped all of the files and emailed them or made them available via dropbox? By the way do you have a debugger that allows you to step

Re: Still having trouble with saving BelongsToMany data

2015-02-25 Thread heavyKevy
Joe, Here is what I did: In the attribute entity: protected $_accessible = [ 'id' = true, 'name' = true, 'listings' = true, ]; In the Listings_Attributes Table: public function validationDefault(Validator $validator) { $validator

Re: Still having trouble with saving BelongsToMany data

2015-02-23 Thread heavyKevy
Saving works fine with using the _ids, but as soon as I add join data to the mix, it refuses to save with validation errors. Also, if I include the entire Attribute entity, and remove the validation of attribute_id and listing_id from listings_attributes, I can get the attributes to save, but

Re: Still having trouble with saving BelongsToMany data

2015-02-23 Thread heavyKevy
You are welcome... By the way, others have already submitted bug reports for this issue, so I decided to hold off on submitting a duplicate. --Kevin -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because

Re: Still having trouble with saving BelongsToMany data

2015-02-23 Thread heavyKevy
Joe, Looking more carefully, I see that the tickets are recently closed. I did a composer update --prefer-dist, rebaked the listingsAttributes controller and templates, removed the validation for attribute_id and listing_id from the listings_Attributes table and it is saving the listings and

Re: Still having trouble with saving BelongsToMany data

2015-02-22 Thread heavyKevy
If Listings is the table being saved, having attributes, then there seems to be something wrong with your data. I believe that your data should look like the following: $data = [ 'attributes' = [ [ 'id' = 3, //provided the id is already known '_joinData' = [

Re: Still having trouble with saving BelongsToMany data

2015-02-22 Thread heavyKevy
I took the time to construct a test project with the 3 join tables and was able to get data that looks like the documentation requires, but it refuses to save. The joint marshaller chokes because no listing_id, and no attribute_id is found when marshalling the _joinData. I don't see in the

Re: Still having trouble with saving BelongsToMany data

2015-02-22 Thread heavyKevy
Actually Joe, The listing does not save for me. I get the error that it couldn't save. Also, the debugger shows that the entities for the joint data have errors which say that the attribute_id and listing_id are required but not supplied. In that the attribute_id is known, it could be passed

Re: cakePHP3 password confirmation

2014-11-14 Thread heavyKevy
Here is how I did it in Cake 3: In the User Entity, make sure the $accessible list contains the confirm_password whether you store it in the Db or not... and that you use the setPassword method to hash your password when setting it. protected $_accessible = [ 'username' = true,

Re: AppController::beforeRender usage question.

2014-11-06 Thread heavyKevy
Generally you get the black hole if you add fields to the form without using the form helper. If you need to add information to the form that is not exposed to the user, use hidden fields. On Thursday, November 6, 2014 10:48:06 AM UTC+7, glk wrote: Hello everyone, I'm trying to add data

Re: Best practice for changing entity in afterSave

2014-10-07 Thread heavyKevy
It seems to me that the entity used to save the record in the save call is updated and available in the controller after the save call is complete... Are you saying that modifications in that Entity are not showing up in the controller afterwards? On Monday, October 6, 2014 4:34:41 PM UTC+7,

Re: CakePHP 3.0 autocomplete

2014-10-01 Thread heavyKevy
I got the Autocomplete widget to work with the following: Same autocomplete widget file as you but different code in controller and view file: Controller: public $helpers = [ 'Form' = [ 'widgets' = [ 'autocomplete' = ['App\View\Widget\Autocomplete']

Re: Cake 3 Security Component black holes add with associations

2014-09-11 Thread heavyKevy
+2, heavyKevy wrote: No, following is the add.ctp: echo $this-Form-input('name'); $Selected =0; if($role != 'admin' $role != 'prog-admin') { $Selected = $this-resortId; } echo $this-Form-input('user_id', ['title'='Promotion Resort/Program','options' = $resorts, 'selected'=$Selected

Re: Cake 3 Security Component black holes add with associations

2014-09-04 Thread heavyKevy
Ok, Thank you... On Thursday, September 4, 2014 4:09:19 AM UTC+7, heavyKevy wrote: I have promotions owned by a user and associated with other users. The Add screen gives a Select control for selecting the owner and a multi-select for selecting the associated users. In PromotionsTable

Cake 3 Security Component black holes add with associations

2014-09-03 Thread heavyKevy
I have promotions owned by a user and associated with other users. The Add screen gives a Select control for selecting the owner and a multi-select for selecting the associated users. In PromotionsTable:: public function initialize(array $config) { $this-table('promotions');

Cake3 advanced install, does it work?

2014-08-23 Thread heavyKevy
Hello, I am having difficulty getting the following to work: In: http://book.cakephp.org/2.0/en/installation.html SECTION: Using one CakePHP Checkout for multiple Applications It states how to use a single cake install for multiple cake projects. In addition,

Re: Cake3 advanced install, does it work?

2014-08-23 Thread heavyKevy
I seem to have discovered a solution: In the Vendor/Composer folder In the file: Autoload_psr4.php Hardcoded the path to my cake3 libraries 'Cake\\' = array('c:/cake/cake3/cakephp/src'), Initial URL now shows success... -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on

Cake 3 Questions

2014-05-11 Thread heavyKevy
I have questions about the handling of images in Cake3. 1. Having taken the upload plugin and worked on modifying it to work with Cake 3, I have discovered that the data passed in the events make it difficult to process files due to the name of the field not being passed along: Should the

Re: Is anyone else getting a zend_mm_heap corrupted error with Cake 3 such that pages never finish loading?

2014-03-12 Thread heavyKevy
The issue with trying to update my PHP is that WAMP does not have a newer 64bit build, and the newer 64 bit builds that I can find are compiled with a different version of VC such that they likely won't play nicely. Is there any way to verify that it is a PHP bug? On Wednesday, March 12,

Is anyone else getting a zend_mm_heap corrupted error with Cake 3 such that pages never finish loading?

2014-03-10 Thread heavyKevy
I am using Windows 7 64 bit WampServer Version 2.2 Apache 2.4.2 Php 5.4.3 MySql 5.5.24 Eclipse 3.0.2 The problem happens both when browsing within Eclipse (in development mode and debugging) and when using Firefox. When I first began to use Cake 3, everything worked fine, but about 2 weeks

Re: Is it possible to do watch window debugging of cakephp code?

2014-01-03 Thread heavyKevy
Yes, you can download eclipse the php package and install Xdebug and it can be configured to step through your code. It is a bit of a pain to get it all set up, but there is a fair amount of help that can be found through using Google. Make sure you download the correct eclipse package though as

Re: User Authentication with 2 different tables

2013-07-17 Thread heavyKevy
When the user goes to log in, what determines which table is used? Did you read this page: http://book.cakephp.org/2.0/en/core-libraries/components/authentication.html Specifically Configuring Authentication handlers? It appears to me that you can do something in the before filter to figure

Re: Is there a way to get a 'has many' relationship left joined without forcing the join such that I can get a count of the child table?

2013-06-03 Thread heavyKevy
-together.html#belongsto On Wed, May 29, 2013 at 5:39 AM, heavyKevy arnett...@gmail.comjavascript: wrote: I am trying to extend the blog example where my Posts belong to Users and Posts has many comments and to get a query where the comments are left joined into the query such that I can get

Is there a way to get a 'has many' relationship left joined without forcing the join such that I can get a count of the child table?

2013-05-30 Thread heavyKevy
I am trying to extend the blog example where my Posts belong to Users and Posts has many comments and to get a query where the comments are left joined into the query such that I can get a comment count for each post for listing out in my index page. According to the documentation, it

Possible bug in Auth?

2008-06-14 Thread heavyKevy
($this-allowedActions == array('*') || in_array($controller-action, $this-allowedActions))) { return false; } Thanks, --heavyKevy --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group