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
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.
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
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.
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',
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
>
> 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
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
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
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
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
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`,
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 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
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
>
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
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()
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
: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',
>
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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' = [
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
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
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,
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
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,
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']
+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
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
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');
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,
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
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
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,
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
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
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
-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
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
($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
56 matches
Mail list logo