# |
Dec 20th 2017, 13:17 |
saeideng |
and primary key can not null/empty |
# |
Dec 20th 2017, 13:17 |
saeideng |
get just expect a primary key id |
# |
Dec 20th 2017, 13:16 |
justcharlz |
@saeideng the record in the database table is empty so I want to know if it returns null when database is empty |
# |
Dec 20th 2017, 13:16 |
saeideng |
>when you try to get(id) >that expect a record with primary key = $id >otherwise returns an error |
# |
Dec 20th 2017, 13:15 |
saeideng |
because I answered your question above |
# |
Dec 20th 2017, 13:15 |
justcharlz |
@saeideng under the :middle_finger: |
# |
Dec 20th 2017, 13:14 |
saeideng |
returning false/null when not found any thing ? |
# |
Dec 20th 2017, 13:14 |
saeideng |
what you need? |
# |
Dec 20th 2017, 13:14 |
saeideng |
what no? |
# |
Dec 20th 2017, 13:13 |
justcharlz |
what for? |
# |
Dec 20th 2017, 13:13 |
justcharlz |
@saeideng hmmm |
# |
Dec 20th 2017, 13:09 |
saeideng |
:middle_finger: |
# |
Dec 20th 2017, 13:09 |
saeideng |
justchariz |
# |
Dec 20th 2017, 13:06 |
justcharlz |
hello guys. need help. I am getting "Record not found" when I try retrieving data using get($id). Does result retrieve return boolean or null when I use get($id) |
# |
Dec 20th 2017, 13:06 |
saeideng |
otherwise returns an error |
# |
Dec 20th 2017, 13:05 |
saeideng |
that expect a record with primary key = $id |
# |
Dec 20th 2017, 13:05 |
saeideng |
when you try to get(id) |
# |
Dec 20th 2017, 12:51 |
justcharlz |
hello guys. need help. I am getting "Record not found" when I try retrieving data using get($id). Does result retrieve return boolean or null when I use get($id) |
# |
Dec 20th 2017, 12:01 |
neon1024 |
Question for the core team ;) |
# |
Dec 20th 2017, 12:01 |
neon1024 |
Not sure if the CSRF works via Ajax though |
# |
Dec 20th 2017, 12:00 |
neon1024 |
If I remember my SecurityComponent correctly |
# |
Dec 20th 2017, 12:00 |
neon1024 |
That does mean someone can form tamper you |
# |
Dec 20th 2017, 12:00 |
danishkhan3621 |
@neon1024: after adding $this->Security->config('unlockedActions',array('update')); it started working |
# |
Dec 20th 2017, 11:51 |
neon1024 |
..and it’d be nice if it was compatible with the CakePHP coding standard :P |
# |
Dec 20th 2017, 11:50 |
neon1024 |
So I guess to answer your question, it’s because your code has multiple bugs |
# |
Dec 20th 2017, 11:50 |
neon1024 |
I would guess you’re upgrading a Cake 2 application ;) |
# |
Dec 20th 2017, 11:50 |
neon1024 |
Passing a string of the model name is the Cake 2 way |
# |
Dec 20th 2017, 11:49 |
neon1024 |
You’re also not assigning an entity to your `Form->create()` |
# |
Dec 20th 2017, 11:49 |
dereuromark |
always check logs and stacktrace of debug output |
# |
Dec 20th 2017, 11:49 |
danishkhan3621 |
i'm on cakephp 3 and saving data in session it is working fine without ajax |
# |
Dec 20th 2017, 11:49 |
neon1024 |
Perhaps it’s a routing issue, with the capitalisation of the url? |
# |
Dec 20th 2017, 11:49 |
dereuromark |
True |
# |
Dec 20th 2017, 11:48 |
neon1024 |
Who knows what it’s doing |
# |
Dec 20th 2017, 11:48 |
neon1024 |
Well it’s `saveProduct()` so that method might make an entity |
# |
Dec 20th 2017, 11:48 |
dereuromark |
deprecated stuff doesnt break the cake ;) yet |
# |
Dec 20th 2017, 11:48 |
dereuromark |
the problem is that you cant save arrays, must be patched into entities |
# |
Dec 20th 2017, 11:48 |
dereuromark |
datais fine |
# |
Dec 20th 2017, 11:47 |
neon1024 |
I’ll ignore the odd formatting, but stuff like this, `$this->request->data['count']` isn’t really correct, you should be using `$this->request->getData('count')` if you’re on CakePHP 3.4+ |
# |
Dec 20th 2017, 11:47 |
neon1024 |
Are you in Cake 2 because some of your code looks very Cake 2 |
# |
Dec 20th 2017, 11:46 |
danishkhan3621 |
Why i'm getting error: Bad request when trying to submit post data using ajax in Cakephp 3 , here is my code https://pastebin.com/H5RmnDtF |
# |
Dec 20th 2017, 11:22 |
dereuromark |
Especially in 3.x :slightly_smiling_face: no more sharing, no more issues with depth. and you can easily unit test them |