Log message #4141440

# At Username Text
# May 16th 2018, 15:16 pmoraes I'm having a really strange issue
# May 16th 2018, 15:16 pmoraes cakephp 3.6
# May 16th 2018, 15:16 pmoraes by a chance, anyone is having any issues with Flash messages?
# May 16th 2018, 15:15 pmoraes good morning guys
# May 16th 2018, 15:15 neon1024 Also you might want to add a rule to your webserver to prevent missing file urls being passed to PHP
# May 16th 2018, 15:15 neon1024 But you can also use `$this->Html->image('/files/example.jpg')` just as @saeideng suggested :thumbsup:
# May 16th 2018, 15:14 neon1024 I tended to use `$this->Html->image('../files/example/test.jpg');`
# May 16th 2018, 15:08 saeideng just add `/` before the `images`
# May 16th 2018, 15:07 saeideng `this->Url->image(`/images/1.jpg')
# May 16th 2018, 15:01 alexdd55 i saved images under files and now i get a warning because “controller files does not exist” .. any idea?
# May 16th 2018, 14:57 neon1024 @admad Thanks again for the tips, I have something functioning now that I can build on :thumbsup:
# May 16th 2018, 14:51 lorenzo right, the thing is that translate behavior can also filter results based on whether or not the translation is present
# May 16th 2018, 14:50 ndm @itmpls You're welcome
# May 16th 2018, 14:50 ndm @lorenzo I see. It was at least unexpected, given that the `*JoinWith()` methods are described to not include the data. And the time it took to debug this to figure out what's causing it was indeed a little annoying ;)
# May 16th 2018, 14:50 alexdd55 is it possible to define a folder like img/ css/ adiditioanlly… need a folder files/ to be handled like those others
# May 16th 2018, 14:49 itmpls save my life on a daily basis
# May 16th 2018, 14:49 itmpls @ndm dude, thank you for all your answers on SO if I haven't already said it
# May 16th 2018, 14:48 alexdd55 whaddap dudes
# May 16th 2018, 14:45 lorenzo if it is annoying we could add code to the behavior to read a query option to disable itself
# May 16th 2018, 14:45 lorenzo translate behavior is not special
# May 16th 2018, 14:45 lorenzo joinWith is always going to attach any logic that the association has
# May 16th 2018, 14:44 lorenzo yes
# May 16th 2018, 14:41 ndm @lorenzo A quick question in case you're not busy... Is it the expected behavior that when using the query builders `*JoinWith()` methods with associations that have the `Translate` behavior attached, this causes the joined association to also be contained, ie the associated records are being queried and included in the results?
# May 16th 2018, 14:39 itmpls and if there isn't an established valid refresh token as well
# May 16th 2018, 14:38 itmpls anyone familiar with refresh token flow? once i create a refresh token for an access token, i'm letting the "claim" last 2 hours. should my client side app try just refreshing it at an X interval if the initial access token has expired?
# May 16th 2018, 14:31 admad the code is correct :slightly_smiling_face:
# May 16th 2018, 14:30 neon1024 Your docblock says 304, but your code is 301 :P
# May 16th 2018, 14:29 neon1024 Thanks! I’ll take a look
# May 16th 2018, 14:29 admad use that instead of core `ErrorHandlerMiddlware`
# May 16th 2018, 14:29 neon1024 No harm in teaching me something.
# May 16th 2018, 14:28 admad @neon1024 i am in a spoon feeding mood :slightly_smiling_face: https://gist.github.com/ADmad/606beddce65495d37d5e0bce1e2a7c04
# May 16th 2018, 14:23 neon1024 It’s all a bit new as we tend to do this in Nginx, but some of the redirects are complicated.
# May 16th 2018, 14:19 neon1024 Cool, well I will try and capture a 404 first, and that will give me an idea of where to start
# May 16th 2018, 14:19 saeideng you have a lot of ways to do it :,)
# May 16th 2018, 14:18 neon1024 Well yeah, that’s what I thought, but couldn’t I overload the `ErrorHandlerMiddleware::handleException` ? I should go and look at Crud and see how it captures those 404s I suppose
# May 16th 2018, 14:17 slackebot ->add($this->redirect()) ; return $middlewareQueue; } public function redirect() { return function($request, $response, $next){ $response = $next($request, $response); if ($response->getStatusCode()==404) { $response = $response->withHeader(' ....redirect ....'); } return $response; }; } ```
# May 16th 2018, 14:17 saeideng ``` public function middleware($middlewareQueue) { $middlewareQueue // Catch any exceptions in the lower layers, // and make an error page/response ->add(ErrorHandlerMiddleware::class) // Handle plugin/theme assets like CakePHP normally does. ->add(AssetMiddleware::class) // Add routing middleware. ->add(new RoutingMiddleware($this))
# May 16th 2018, 14:17 saeideng @neon1024 did not test but
# May 16th 2018, 14:12 neon1024 Sorry, I misunderstood what you meant. I’ll go do some reading! Thanks for the tips
# May 16th 2018, 14:11 admad i already told you to use custom error handler middleware instead :slightly_smiling_face:
# May 16th 2018, 14:10 saeideng you should use response