Logs for #cakephp

Page 5 of 34,879, showing 100 records out of 3,487,833 total, starting on record 401, ending on 500

# At Username Text
# May 26th, 12:31 hmic thats eighter rbac or acl with me. depending on the degree of controll you want
# May 26th, 12:29 obinoob hmic: for example user can only add if he meets a few requirements... authorization yes but with a refined degree
# May 26th, 12:25 hmic plugins for both do exist
# May 26th, 12:25 hmic if thats not enough, you will need a full blown ACL solution
# May 26th, 12:25 obinoob hmic you're probably right about it
# May 26th, 12:25 hmic the first thing to consider, besides hardcoded groups of users, is RBAC authorization
# May 26th, 12:25 obinoob I also learned that components will not need view components or a build up responses right?
# May 26th, 12:25 hmic probably you are looking for authorization stuff? not validation?
# May 26th, 12:23 obinoob whats my best options to validate an action based on business rules I mean besides the form validation on CRUD, what if I need to verify if user meets requirements before he does something and requirements meet a few validation rules? I'm starting to think that must be a very unique way of doing this or i will end up hacking the framework and thus fighting a lot of concepts...
# May 26th, 12:11 NeoTherm1c|Work Yep
# May 26th, 12:11 inoas Neon1024: NeoTherm1c|Work this should do the trick shouldnt it
# May 26th, 12:11 inoas https://book.cakephp.org/3.0/en/core-libraries/validation.html#conditional-validation
# May 26th, 11:46 inoas okay
# May 26th, 11:46 inoas thought there may be something
# May 26th, 11:45 Neon1024 inoas: I agree with NeoTherm1c|Work
# May 26th, 11:43 obinoob hmic: I've only wrote a component because I've found that I can only validate controller action on crud methods under buildRules, but I can't validate business rules within validation so... now i need to retrieve a response from my component which requires Flash component I'm sure I'm doing something terrible wrong
# May 26th, 11:36 NeoTherm1c|Work custom validation function?
# May 26th, 11:35 inoas on save
# May 26th, 11:35 inoas how do I best validate if field = FOO another field must be BAR
# May 26th, 11:33 hmic so load it there - you can do so from the component scope by accessing the controller it is attached to
# May 26th, 11:33 hmic not the component needs the flashcomponent, but the controller
# May 26th, 11:32 obinoob hmic: I've converted my trait to a component, I need Flash in my new component is that possible? If yes how can I load it?
# May 26th, 11:31 eax Good point! Thanks :)
# May 26th, 11:31 hmic if not, provide a testcase - based on the one thats there - that does and fails
# May 26th, 11:30 hmic you should check the testcase mark has added for the issue and if that fits your case
# May 26th, 11:25 eax That's the "old" issue, which I can still reproduce :)
# May 26th, 11:24 eax hmic: https://github.com/cakephp/cakephp/issues/10633
# May 26th, 11:24 hmic eax: post a link to the issue please
# May 26th, 11:24 eax Thanks! :)
# May 26th, 11:24 hmic of course
# May 26th, 11:23 cleptric Both ^^
# May 26th, 11:23 eax Okay, thanks cleptric! Should I refer to the original issue and pr, or? :)
# May 26th, 11:23 hmic does not need to be in the initialize method
# May 26th, 11:23 hmic obinoob, from any controller context. not from a table context of course where a behavior would get attached
# May 26th, 11:22 obinoob hmic: I think I would have to use initialize method right?
# May 26th, 11:22 cleptric @eax Simply open another issue :slightly_smiling_face:
# May 26th, 11:22 eax rchavik: It is a bit above my level to fix it, sadly :)
# May 26th, 11:22 obinoob hmic yes behaviour stupid observation... how can I load $this->loadComponent('Flash'); in my new component is that possible?
# May 26th, 11:21 rchavik submit a PR that really fix it with a test case :)
# May 26th, 11:17 eax Hey folks! I reported an issue in Cake3 a while back (about 2.5 weeks); which got fixed with a pr that was merged and released in 3.4.7 - However, the solution doesn't actually fix the bug I found :( (In other words, I can still reproduce it in 3.4.7) - What is the correct/most polite way of informing of this? :)
# May 26th, 11:12 hmic you said you are doing sql queries, so i would think it fits the category of a behavior
# May 26th, 11:08 obinoob hmic: ;) so my custom class would fit in category of Helpers I believe...
# May 26th, 11:04 hmic thats the cake way you have asked for
# May 26th, 11:03 hmic with a registry!
# May 26th, 11:03 obinoob hmic: let me expose my ideia with a small code example I think it can clear up things a bit, this is a stupid argument probably but I just want to find a way I can reuse a custom object instance in my code ;)
# May 26th, 11:01 hmic you could easily utilize the generic objectregistry to load and get your custom class when-/whereever
# May 26th, 11:01 hmic there are more registries uses in cake than the tableregistry
# May 26th, 11:00 hmic if thats not what you want, you can use a registry to get the instance whenever and whereever you need it. exactly like the table class you get from the tableregistry
# May 26th, 10:59 hmic why every method? if the trait is attached to a class, you can add the instance to that class
# May 26th, 10:59 obinoob available for trait and all the classes that use trait's codes
# May 26th, 10:59 hmic but still: i'd add the functionality to te table, from what you have said.
# May 26th, 10:58 obinoob I just want to have one instance
# May 26th, 10:58 obinoob but I've found I need a new instance in every method on the trait
# May 26th, 10:58 hmic use a registry!
# May 26th, 10:58 hmic and you need a way to access it
# May 26th, 10:58 obinoob the custom class instance is being used in trait
# May 26th, 10:58 hmic so*
# May 26th, 10:57 hmic you have been talking about a trait
# May 26th, 10:57 obinoob I've a trait and a custom class
# May 26th, 10:57 obinoob hmic: I know that
# May 26th, 10:57 hmic a trait is no class
# May 26th, 10:57 hmic or use a dependency injection container (which cake does not in the core IMHO) but there exist plugins for cake that provide you with that functionality too
# May 26th, 10:57 obinoob hmic: I'm using the TableRegistry at my custom class
# May 26th, 10:56 hmic so in your case, you eighter want to utilize this registry pattern - use ones that cake already has
# May 26th, 10:56 obinoob hmic: either by a static method TableRegistry or by calling $this->table
# May 26th, 10:56 hmic through the TableRegistry! this is the most commonly used/exposed registry that cake provides. but there are more. they are globally accessible and provide you with object instances
# May 26th, 10:55 hmic how do you access a table object?
# May 26th, 10:55 hmic think of the tables classes again please
# May 26th, 10:54 obinoob and I could call it on the class that I will be using the trait
# May 26th, 10:54 hmic thats not what you want
# May 26th, 10:54 hmic still you need to access the same object instance from there, so you need to pass it in
# May 26th, 10:54 hmic additionally, you dont want to pass the object instance around likely
# May 26th, 10:54 obinoob hmic: but I can have a constructor on a trait
# May 26th, 10:53 hmic only the object the trait is attached to can have state.
# May 26th, 10:53 hmic first off: a trait has no state.
# May 26th, 10:53 obinoob hmic: ok I get the ideia and I agree with it, but lets pretend i need to create some custom class it can be a component it doesn't matter for the example
# May 26th, 10:50 hmic this can be added from a trait, if you think thats a good idea. i dont. it could be a behavior attached to your table too, which sounds way better
# May 26th, 10:49 hmic wait, the user database queries should be custom finders *in your table*
# May 26th, 10:49 obinoob hmic: *sorry a single UserData instance
# May 26th, 10:48 obinoob hmic: I've a trait that I am using for app business rules in controller but I've found that i could make my life much simpler if i could wrap all user database queries in a class so now I need a way of create a single UserData class to use in my trait
# May 26th, 10:46 hmic and the usecase
# May 26th, 10:46 hmic obinoob, maybe you explain your goal first
# May 26th, 10:45 obinoob I don't want to create a new object instance in every method, I'm sure there must be a way ;) a cakes way
# May 26th, 10:42 obinoob also tried to implement lazy loading without success, so if there is somebody willing to help me on this new topic I would be very happy
# May 26th, 10:41 obinoob Hi, after a lot of efforts I still don't know how to create an object instance on a trait, the object should be available in trait global scope so I could share it across multiple methods. I've tried a constructor function and initialise method as well none has worked
# May 26th, 10:17 Neon1024 unset($this->request->data['hub']);
# May 26th, 10:17 Neon1024 }
# May 26th, 10:17 Neon1024 if (empty($this->request->getData('hub')) andand !empty($this->request->getData('hub_id'))) {
# May 26th, 10:17 Neon1024 I’m here currently
# May 26th, 10:17 Neon1024 But the key still exists in the post data then
# May 26th, 10:17 Neon1024 $this->request = $this->request->withData(‘hub’, null);
# May 26th, 10:16 Neon1024 All I can think is
# May 26th, 10:16 Neon1024 Then the existing one would still be there, be caught by the validation and the save would fail
# May 26th, 10:12 steinkel using the current spec, you could add another data key to match this condition, like 'hub_deleted'
# May 26th, 10:10 hmic there has been quite some noise on that on the mailing list before i think...
# May 26th, 10:10 hmic Neon1024, i'm on your side. i think they sould eighter remove methods to add data to the request or add methods to delete them too in the psr-7 spec
# May 26th, 10:08 Neon1024 So in 4.0 you’ll not be able to remove keys and values from the request, unless a method is added
# May 26th, 10:08 NeoTherm1c|Work hmic, I know that I need to check for breakage for 2.8 from 2.7, looking at the changes I might also need to double check how we see IP addresses and evaluate anything that might be using the Object
# May 26th, 10:08 Neon1024 There is no method to match unset($ths->request->data[‘hub’])
# May 26th, 10:08 Neon1024 So I have to check for the foreign key or new data, and adjust the request data