Logs for #cakephp

Page 2 of 36,308, showing 100 records out of 3,630,750 total, starting on record 101, ending on 200

# At Username Text
# Today, 10:20 neon1024 https://github.com/cakephp/cakephp/blob/master/src/View/Form/EntityContext.php#L475
# Today, 10:20 jotpe Oh no - magic hits again - `protected function _magicOptions`
# Today, 10:19 neon1024 If you’re using EntityContext
# Today, 10:19 neon1024 Which in most cases will be an entity
# Today, 10:19 neon1024 https://github.com/cakephp/cakephp/blob/master/src/View/Helper/FormHelper.php#L1459
# Today, 10:19 neon1024 Seems you need to debug the form context
# Today, 10:13 jotpe IS there a way I can debug, if the entity is required in the view?
# Today, 10:10 neon1024 :thinking_face:
# Today, 10:09 jotpe Both Entities doesn't have required fields
# Today, 10:09 jotpe For Submitter: yes, For Author: no
# Today, 10:08 neon1024 @jotpe Does the entity you set to the form contain the field?
# Today, 10:07 jotpe @neon1024 yes, it's required. If I add the form in the add.ctp of Submitter it's shown.
# Today, 09:45 fhxfhx k gotit, just adjusted the url to 2.5.1
# Today, 09:26 neon1024 @jotpe Is the field required in your validation?
# Today, 09:16 fhxfhx didn't find how to download cake 2.5.1 from git ... where do i find it ?
# Today, 08:47 alexdd55976 i understand :)
# Today, 08:43 jotpe yeah...well could do it, but ~30inputs :grimacing:
# Today, 08:38 alexdd55976 add the required manually would be just a workaround
# Today, 08:38 alexdd55976 hm
# Today, 08:37 jotpe Values are set correctly in the form fields
# Today, 08:37 jotpe How do i check? In my Controller i did `$talk->submitter = $this->Talks->Submitters->newEntity()` and set `$this->set(compact('talk','categories'));`
# Today, 08:35 alexdd55976 does the view know about the association to the submitter model?
# Today, 08:34 alexdd55976 oh.. i read your question wrong
# Today, 08:33 jotpe My author model looks like this 'author.0.first_name', still the same with the required fields over there
# Today, 08:33 jotpe Nope. Just have one submitter, and it's saving correctly
# Today, 08:32 alexdd55976 just a wild guess
# Today, 08:32 alexdd55976 really dunno...
# Today, 08:32 alexdd55976 doesn'T it have to be `control('submitter.0.first_name,...`??
# Today, 08:29 jotpe I have some nested Forms (Talk->Submitter or Talk->Author). Is there any reason, associated forms don't get the required tag, when I add them like this? `<?= $this->Form->control('submitter.first_name', ['label' => __('Vorname')]) ?>`
# Today, 08:07 conehead Well if you actually want to get rid of cookies, yes
# Today, 08:05 chupa i think i already saw this one and thought of implementing it, but frontend is easy, i thought there was more to do controller-wise
# Today, 08:03 conehead https://cookieconsent.osano.com/documentation/about-cookie-consent/
# Today, 08:02 chupa yeah, will do that, but i think it should be enough due to the nature of the project
# Today, 08:01 conehead Well I am not a lawyer haha. Your company better double checks it with their lawyer if that is alright for you. As far as I know this is currently enough
# Today, 07:54 chupa Awesome, so I just need a notification bar and that's it :) ty
# Today, 07:51 conehead Without the need to actually disable them. Especially for stuff like logging in
# Today, 07:50 conehead But currently I think it is allowed to just add a notice that some cookies are required for the homepage to work
# Today, 07:50 conehead Sure it can work without cookies
# Today, 07:44 chupa Hey, how are you handling GDPR cookies policy? What do I need to if someone opts out of using cookies? Can CakePHP even work without them?
# Today, 07:23 alexdd55976 nah. not really
# Today, 07:22 conehead Don't think so. You want to create one?
# Today, 07:19 alexdd55976 is there a cakephp podcast?
# Today, 06:54 alexdd55976 morning fellows
# Today, 06:42 conehead Can't say there is not. I would guess there is not :P
# Today, 06:42 jotpe :slightly_smiling_face:
# Today, 06:42 jotpe Okay, that's what I also considered, but thought there's a easier way.
# Today, 06:41 conehead So might wanna extend FormHelper, check if field is required and append a `*`?
# Today, 06:40 conehead I would guess this is part of the label
# Today, 06:37 jotpe I have a custom app_form.php with custom templates
# Today, 06:37 jotpe But how do I need so check if a field is required?
# Today, 06:36 conehead https://api.cakephp.org/3.8/class-Cake.View.Helper.FormHelper.html#%24_defaultConfig
# Today, 06:36 conehead https://book.cakephp.org/3.0/en/views/helpers/form.html#customizing-the-templates-formhelper-uses
# Today, 06:35 conehead @jotpe create a default template and set it in appview
# Today, 06:25 jotpe How can I change the templates of FormHelper so that the Labels of required Controls get a hint htat it's required? E.g. `<label>E-Mail <strong>*</strong></label>`
# Today, 06:18 jotpe @valerij.bancer I had the same issue when migrating from 2.x to 3.x and ended up doing something like this https://www.dereuromark.de/2010/06/24/static-enums-or-semihardcoded-attributes/ but in Entities with a trait.
# Today, 06:15 jotpe Morning
# Today, 05:17 javier.villanueva morning all
# Today, 04:40 conehead Good morning guys
# Yesterday, 20:55 admad nucc11: https://github.com/cakephp/app/blob/master/config/bootstrap.php#L47
# Yesterday, 19:20 nucc11 it appears that the development server doesn't automatically load the contents of .env file, or am i missing something?
# Yesterday, 18:16 c.wichmann Ä
# Yesterday, 16:43 valerij.bancer I wish we would not use cake 2.x at all
# Yesterday, 16:38 admad no one's forcing you to use CakePHP or if someone is take it up with them :slightly_smiling_face:
# Yesterday, 16:34 valerij.bancer what should projects with enum data types do? migrate to another framework?
# Yesterday, 16:31 admad "no and probably never will be"
# Yesterday, 16:25 valerij.bancer I mean MySQL data type `enum`. cakedc/enum seems to be something different
# Yesterday, 16:23 admad no and probably never will be. There are plugin's to emulate enums though, like cakedc/enum
# Yesterday, 16:21 valerij.bancer is there any support of enum data type in 3.x?
# Yesterday, 15:21 nucc1 doesn't look like there's a way to allow-all, so go ahead without the Authentication component.
# Yesterday, 15:06 admad the 2 components are not dependent on each other
# Yesterday, 15:03 nucc1 I like the convenience as well, but i want to do the decision making about what to do myself
# Yesterday, 15:03 nucc1 I am hoping to use the Authorization comonent as well and assumed they go together
# Yesterday, 15:02 admad the component just provides some extra convenience, it's not really necessary for the auth process
# Yesterday, 15:02 admad *that's one way
# Yesterday, 15:02 admad they one way. Another thing is for what else do you need the component?
# Yesterday, 14:58 nucc1 did you mean make it default to allow-all and then just read the results and do what I desire? I can't see how too use it without loading it
# Yesterday, 14:52 nucc1 thanks. :)
# Yesterday, 13:30 admad *AuthenticationComponent
# Yesterday, 13:30 admad nucc1: just dont load the AuthComponent? Then you can just check result and do whatever you want
# Yesterday, 12:59 nucc1 when using the Authentication plugin, is it possible to catch and do something else with the UnAuthenticatedException, or do I have to rely on the redirect?
# Yesterday, 12:42 noel There are but they don't seem to work for json-api. Thx anyhow.
# Yesterday, 12:27 adam282 I am sure there is some built-in Cake routines and response handlers for JSON
# Yesterday, 12:26 adam282 Honestly, I have no idea as in the last app I wrote, I had a small subset of functions that required a JSON response and that was CakePHP 2.x so I did it the way you just mentioned.
# Yesterday, 12:22 noel @adam282 turning off autorender and setting the layout to false does indeed prevent the template from being required, which is cool. However _serialize doesn't result in any output. Is there a way to interact with crud-json-api's classes so as to build up a json-api response? Obviously I build up an array manually and then json_encode it and send it as a response but that seems like re-inventing the wheel.
# Yesterday, 12:18 noel Ok tx I'll try that. I found this works although it seems heavy-handed: ``` public function index() { if ($this->request->is('jsonapi')) { $response = new \Cake\Http\Response; $response = $response->withType('application/json') ->withStringBody(json_encode(['success' => true])); } return $response; } ```
# Yesterday, 12:13 adam282 Something like this inside your function inside your Controller: ``` $this->viewBuilder()->setLayout(false); $this->autoRender = false; ```
# Yesterday, 12:12 adam282 Yeah, you need to turn off autorender and set the layout to false
# Yesterday, 12:09 noel Hi. Working with crud-json-api – is there a way to have a custom response that has nothing to do with table's in the database for a particular Controller? I tried doing `$this->loadComponent('RequestHandler')` and `$this->set('_serialize', ['myVar'])` but it still seems to be asking for the template.
# Yesterday, 11:19 admad @val https://github.com/FriendsOfCake/fixturize
# Yesterday, 09:34 valerij.bancer Hi, is there an alternative of Fixturize plugin in 3.x? https://github.com/lorenzo/cakephp-fixturize
# Yesterday, 07:29 maymeow need adwise I have relations `users -> addresses -> posts` When administrator wants to delete address or user what to do or what are you doing? • Cascading delete ? (so all things related to users and addresses are deleted • Deactivate user address etc ... so all posts are keep in database?
# Sep 21st, 23:19 D-rex How do I disable csrf?
# Sep 21st, 23:18 D-rex Keep getting CSRF token mismatch even after rem,oving the middleware from the route scope
# Sep 21st, 20:55 noel Ok nvm. Got it
# Sep 21st, 20:39 noel Actually I got the PATCH request working now. However I still have the issue with the exception renderer.
# Sep 21st, 18:50 noel So I assume this is because errorException renderer isn't set up for JSON API... but I can't seem to get that set up using the information in the docs. Any help appreciated tx.
# Sep 21st, 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, 18:49 slackebot Crud\Error\Exception\ValidationException ```
# Sep 21st, 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, 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.