Log message #4205058

# At Username Text
# Sep 21st 2019, 18:49 slackebot Crud\Error\Exception\ValidationException ```
# Sep 21st 2019, 18:49 noel So this is the body of my PATCH request: ``` { "data": { "type": "cocktails", "attributes": { "id": "22", "name": "Sex on a beach", "description": "Scratchy but fun" } } } ``` and the headers are: ``` Accept: application/vnd.api+json Content-Type: application/vnd.api+json ``` and the return is a 422 Unprocessable exception showing as HTML with the text: ``` A validation error occurred
# Sep 21st 2019, 18:48 noel It works correctly for GET but the problem is that when I try to update via PostMan using a PATCH request, I'm getting an HTML validation error response instead of a json response. Also the validation error is not specified, it just says "validation error".
# Sep 21st 2019, 18:39 noel Hi guys. Can someone please help me to set up error exception renderer for JSON API? The docs here are apparently out of date: https://crud-json-api.readthedocs.io/en/latest/preface/setup.html, what's shown there doesn't work.
# Sep 21st 2019, 16:53 peppejaripappalardo thx anyway
# Sep 21st 2019, 16:53 peppejaripappalardo np @destinydriven
# Sep 21st 2019, 14:22 destinydriven Sysmo, sorry I can’t be of much help
# Sep 21st 2019, 10:04 peppejaripappalardo thx @destinydriven i saw it, but the error persist
# Sep 21st 2019, 09:24 destinydriven @peppejaripappalardo ^
# Sep 21st 2019, 09:20 destinydriven You have duplicate key ‘duration’
# Sep 21st 2019, 09:18 peppejaripappalardo some hint please? :S
# Sep 21st 2019, 09:18 slackebot ],`
# Sep 21st 2019, 09:18 peppejaripappalardo `'_cake_core_' => [` ` 'className' => RedisEngine::class,` ` 'prefix' => 'myapp_cake_core_',` ` 'path' => CACHE . 'persistent/',` ` 'serialize' => true,` ` 'duration' => '+1 years',` ` 'host' => 'gjnas.serveftp.com',` ` 'password' => '*****',` ` 'database' => 0,` ` 'port' => 6379,` ` 'duration' => '+24 hours',` `
# Sep 21st 2019, 09:18 peppejaripappalardo `Cache engine Cake\Cache\Engine\RedisEngine is not properly configured`
# Sep 21st 2019, 09:18 peppejaripappalardo Got an issue with cache
# Sep 21st 2019, 09:18 peppejaripappalardo Hi all
# Sep 21st 2019, 09:07 destinydriven Elasty, thanks. Reciprocated
# Sep 21st 2019, 09:04 adam282 True. I don’t use it absolutely every where though I try my best to. Sorry I couldn’t help any better. I am out, have a good one.
# Sep 21st 2019, 09:04 destinydriven No worries, there’s no law saying that FormHelper has to be used all the time
# Sep 21st 2019, 09:03 destinydriven same difference
# Sep 21st 2019, 09:02 destinydriven yes
# Sep 21st 2019, 09:02 adam282 Oh, well no cause you said it works without form builder
# Sep 21st 2019, 09:02 adam282 It might not be Cake interpreting it but PHP
# Sep 21st 2019, 09:01 adam282 Try `echo $this->Form->hidden("DailyHour.{$i}.employee_id", ['value' => $key, 'id' => false]);`
# Sep 21st 2019, 09:00 destinydriven yes, exactly
# Sep 21st 2019, 09:00 adam282 CakePHP is interpreting `<%= key %>` instead of showing that exactly
# Sep 21st 2019, 09:00 adam282 Oh, I see what you’re saying.
# Sep 21st 2019, 08:59 destinydriven echo “<input name=‘data[DailyHour][{$i}][employee_id]’ class=‘form-control’ value=‘{$key}’ type=‘hidden’>“; works just fine
# Sep 21st 2019, 08:59 destinydriven I can get it to work by not using FormHelper though. Was just wondering
# Sep 21st 2019, 08:59 adam282 Looks like a wanna jQuery
# Sep 21st 2019, 08:59 destinydriven thanks for the attempt :)
# Sep 21st 2019, 08:58 adam282 Hm, never worked with it. Sorry.
# Sep 21st 2019, 08:58 adam282 I would do `<?php echo $key; ?>`
# Sep 21st 2019, 08:58 destinydriven Elasty, its a template variable from underscore js
# Sep 21st 2019, 08:58 adam282 I don’t use short open tags
# Sep 21st 2019, 08:58 adam282 Or something like that.
# Sep 21st 2019, 08:58 adam282 Should be `<?php= $key ?>`
# Sep 21st 2019, 08:58 destinydriven yeah, view source has <%= key %>
# Sep 21st 2019, 08:58 adam282 That’s because you’re missing `$` if it’s a variable
# Sep 21st 2019, 08:57 adam282 Um, view the source and you should see a hidden field
# Sep 21st 2019, 08:57 destinydriven its returning <%= key %> instead of the value