Log message #4262305

# At Username Text
# May 3rd 2021, 14:43 noel I’ve also tried v 4.2.5, no go.
# May 3rd 2021, 14:36 noel How can I get `className` and `through` properties of an association?
# May 3rd 2021, 14:10 erwane WoW, thanks
# May 3rd 2021, 13:48 admad @erwane this should interest you https://github.com/cakephp/cakephp/pull/15477
# May 3rd 2021, 12:24 erwane Does anybody use `cakephp/twig-view` ? I've got an error for this :( ```{{ helper_Html_image('logo_square.png', ['class' => 'd-inline-block']) }}``` It's the first time i use Twig
# May 3rd 2021, 11:18 erwane check 'Fail' in the page content
# May 3rd 2021, 11:18 erwane AssertFlash test Session content. After renderring, Session is consumed
# May 3rd 2021, 09:23 slackebot `$this->Flash->error(__('Fail'));` `return $this->redirect(['controller' => 'systems', 'action' => 'import']);` `}` Is this by design or am I doing something wrong?
# May 3rd 2021, 09:23 slackebot when testing manually. In my ControllerTest I have a positive test case with this check: ```$this->assertFlashMessage('Success');``` This works as expected. I also have a negative test case that fails: ```$this->assertFlashMessage('Fail');``` But this assertion didn’t work. After some investigation, it shows that if I add a redirect to the fail part in my controller code, the assertFlashMessage works: `} else {`
# May 3rd 2021, 09:23 peter.harder Testing question: In a Controller (SystemsController.php) I have an action called “import” with the following code: `if (isset($system->id)) {` `$this->Flash->success(__('Success'));` `return $this->redirect(['controller' => 'systems', 'action' => 'view', $system->id]);` `} else {` `$this->Flash->error(__('Fail'));` `}` `// Renders normal template with form input for file upload` This works as expected
# May 2nd 2021, 15:58 kevin.pfeifer but someday it could be, that i want to go deeper and build the whole system myself :)
# May 2nd 2021, 15:58 kevin.pfeifer since it (at least to me) seem, that cakedc has prepared some utilities to handle e.g. authorization checks in the template
# May 2nd 2021, 15:57 kevin.pfeifer to be honest currently I would just use cakedc/users instead of building the whole authentication and authroization system myself
# May 2nd 2021, 15:55 kevin.pfeifer but thanks for sharing your experience :)
# May 2nd 2021, 15:55 kevin.pfeifer if someday i would encounter that problem
# May 2nd 2021, 15:54 kevin.pfeifer but in this example i was just curious what the "correct" way would be to handle that
# May 2nd 2021, 15:54 kevin.pfeifer to be honest i haven't gotten into any performance issues yet with my app :)
# May 2nd 2021, 15:53 greg138 Refactored a bit to cache that object, and it got a LOT better.
# May 2nd 2021, 15:53 kevin.pfeifer oh ok
# May 2nd 2021, 15:53 greg138 It was mostly that it was creating and destroying the object to check permissions for each entity.
# May 2nd 2021, 15:52 kevin.pfeifer i would guess either caching or correctly set indices on the db will help there a lot
# May 2nd 2021, 15:51 kevin.pfeifer sure that would be pretty catastrophic
# May 2nd 2021, 15:44 greg138 Beware of doing this on something that deals with a lot of entities. Had a situation recently where a long page was timing out because it was doing thousands of permission checks, and each one was about 50ms due to a missed opportunity for caching a key object...
# May 2nd 2021, 15:43 greg138 That would be one way to go.
# May 2nd 2021, 15:42 kevin.pfeifer so like ndm said create a service/utility class which is called in the controller and handed each entity in this class call each policy function to check that authorization and add a virtual field to that entity
# May 2nd 2021, 15:41 kevin.pfeifer mhmm ok
# May 2nd 2021, 15:35 greg138 This sounds to me very much like a policy? They have functions like `canEdit` that take in an entity. They're usually used "transparently" by the authorization system, but they're "just" classes, so you could create one of the type you need and call it repeatedly?
# May 2nd 2021, 15:05 kevin.pfeifer as ndm already said i expect, that you don't have the file `css/bootstrap.css.map` present inside your webroot folder (or a valid symlink to that file)
# May 2nd 2021, 14:00 ndm or that the file actually doesn't exist
# May 2nd 2021, 13:58 ndm There's nothing that would indicate that these two things are related, rather such a missing controller error when targeting assets usually indicates that your server's URL rewriting is not working properly.
# May 2nd 2021, 13:31 etibor and Request URL: /css/bootstrap.css.map
# May 2nd 2021, 13:31 etibor but getting this: Error: [Cake\Routing\Exception\MissingControllerException] Controller class Css could not be found.
# May 2nd 2021, 13:31 etibor i load it in the App controller initialize
# May 2nd 2021, 13:30 etibor my Flash component does not work
# May 2nd 2021, 13:30 etibor hello everyone
# May 1st 2021, 15:47 kevin.pfeifer or as you already said with an event listener :) But to be honest i haven't dealt with event listeners that much either so ,:)
# May 1st 2021, 15:45 kevin.pfeifer or any other configuration at all to be honest ,:)
# May 1st 2021, 15:37 kevin.pfeifer But I can now understand the concept that entites shouldn't deal with authorization directly but rather the part which handles the entites
# May 1st 2021, 15:33 ndm Also, boys and girls, quick tip, reconfiguring your database connections in your apps without having the aliasing in mind that takes place in the test environment, will drive you to the edge... guaranteed!
# May 1st 2021, 15:30 kevin.pfeifer oh wow ok
# May 1st 2021, 15:26 ndm Just recently had the pleasure to work on something where a "base entity" was changing/reconfiguring the application's database connections, oh boy, that was just... no, just no, I've never cursed so much in my whole life :)