# |
Jun 22nd 2018, 13:45 |
lorenzo |
@josbeir done |
# |
Jun 22nd 2018, 13:45 |
lorenzo |
yeah |
# |
Jun 22nd 2018, 13:44 |
josbeir |
but i get why you would do it, its a breaking release :slightly_smiling_face: |
# |
Jun 22nd 2018, 13:43 |
josbeir |
alright i'll see when it happens |
# |
Jun 22nd 2018, 13:43 |
josbeir |
sure, updated my migrations already so no prob for me |
# |
Jun 22nd 2018, 13:43 |
lorenzo |
so the 1.9.0 is going to the deleted |
# |
Jun 22nd 2018, 13:43 |
neon1024 |
If you’d like to redirect 404's take the same advice I did from ADmad and use a custom middleware with a `handleException` method to catch NotFoundExceptions |
# |
Jun 22nd 2018, 13:43 |
lorenzo |
@josbeir heads up, we just had an internal discussion and decided to re-tag it as 2.0.0 |
# |
Jun 22nd 2018, 13:42 |
slackebot4 |
Action: josbeir thanks lorenzo for migrations update |
# |
Jun 22nd 2018, 13:22 |
flavius |
so the seo knows when it lands on a 404 not to index it |
# |
Jun 22nd 2018, 13:21 |
flavius |
File uploaded https://cakesf.slack.com/files/U75U0UMR9/FBCBS0N74/image.png / https://slack-files.com/T053DPNCM-FBCBS0N74-5c51b806fc |
# |
Jun 22nd 2018, 13:19 |
flavius |
redirect immediately, it does that, the response it sends is with the 404 code |
# |
Jun 22nd 2018, 13:18 |
flavius |
what do you mean its really poor, its the default 404 page you should get anytime you misbehave and try to hack the url :slightly_smiling_face: |
# |
Jun 22nd 2018, 13:15 |
erwane |
but maybe i should do that in a middleware |
# |
Jun 22nd 2018, 13:14 |
erwane |
and sometime i need to redirect immediately (no dupplicate for SEO) |
# |
Jun 22nd 2018, 13:14 |
erwane |
Yes but the not found exception is really poor, i need to overide the template |
# |
Jun 22nd 2018, 13:10 |
flavius |
it will throw you to the default cakephp 404 page |
# |
Jun 22nd 2018, 13:10 |
slackebot4 |
redirect page now if (!$input) { throw new NotFoundException('input not found'); } } ``` isnt this what you're looking for? |
# |
Jun 22nd 2018, 13:10 |
flavius |
``` <?php use Cake\Network\Exception\NotFoundException; public function index() { $this->_testMyInput(); // This should not be called if input fail $this->methodShouldNotBeCalledIfInputFail(); $this->set('input', $this->request->getData('input')); } protected function _testMyInput() { $input = $this->request->getData('input'); // Do some tests on $input here // |
# |
Jun 22nd 2018, 13:07 |
erwane |
i will |
# |
Jun 22nd 2018, 13:05 |
saeideng |
>did you try the trait ? no |
# |
Jun 22nd 2018, 13:05 |
saeideng |
it should work |
# |
Jun 22nd 2018, 13:03 |
erwane |
i saw, but there is no solution in fact. di you try the trait ? |
# |
Jun 22nd 2018, 13:00 |
saeideng |
see @dereuromark post |
# |
Jun 22nd 2018, 12:59 |
saeideng |
trait is an option here |
# |
Jun 22nd 2018, 12:58 |
erwane |
@markstory markstory modified the milestones: 3.5.3, 3.5.4 on 27 Sep 2017 @markstory markstory modified the milestones: 3.5.4, 3.6.0 on 7 Oct 2017 @markstory markstory modified the milestones: 3.6.0, 3.7.0 on 15 Apr ... not good. always later :( |
# |
Jun 22nd 2018, 12:57 |
narendravaghela |
:thumbsup: |
# |
Jun 22nd 2018, 12:57 |
saeideng |
:+1: |
# |
Jun 22nd 2018, 12:57 |
erwane |
understood |
# |
Jun 22nd 2018, 12:57 |
saeideng |
>response object is immutable yes but no for `send();` or `stop();` |
# |
Jun 22nd 2018, 12:56 |
saeideng |
`$response->send()` is like hard sending response and it is not flexible |
# |
Jun 22nd 2018, 12:54 |
saeideng |
you need see response in middleware |
# |
Jun 22nd 2018, 12:54 |
erwane |
PSR is strange :S |
# |
Jun 22nd 2018, 12:54 |
saeideng |
no it not logical now |
# |
Jun 22nd 2018, 12:53 |
erwane |
it's look logical |
# |
Jun 22nd 2018, 12:53 |
erwane |
why $response->send() disappear ? |
# |
Jun 22nd 2018, 12:53 |
saeideng |
there are some idea here https://github.com/cakephp/cakephp/issues/11197 |
# |
Jun 22nd 2018, 12:53 |
narendravaghela |
response object is immutable |
# |
Jun 22nd 2018, 12:52 |
saeideng |
because you must return a response |
# |
Jun 22nd 2018, 12:52 |
saeideng |
no there is not |
# |
Jun 22nd 2018, 12:52 |
erwane |
there is no way to stop execution and send response now ? |