Closed connectjames closed 7 years ago
For the first problem:
bin/console debug:event
) - you should see: Zenstruck\RedirectBundle\EventListener\RedirectOnNotFoundListener::onKernelException()
and Zenstruck\RedirectBundle\EventListener\CreateNotFoundListener::onKernelException()
For creating a redirect, it is just the same as any other doctrine entity:
$redirect = new \AppBundle\Entity\Redirect('/source', '/destination');
$em->persist($redirect);
$em->flush();
I reviewed the installation and I don't think I am forgetting anything.
Thanks for the redirect.
I am on Symfony 3 if it makes any difference
When you run app/console debug:container redirect
Do you see:
Select one of the following services to display its information:
[0] zenstruck_redirect.redirect_manager
[1] zenstruck_redirect.redirect_listener
[2] zenstruck_redirect.redirect.form.type
[3] zenstruck_redirect.not_found_manager
[4] zenstruck_redirect.not_found_listener
[5] zenstruck_redirect.remove_not_found_subscriber
[6] zenstruck_redirect.entity_manager
>
?
Yes, but I do not get number 5
That is strange, the event listener's are registered as services but not as event listeners... I don't know how that is possible...
Can you recreate the problem on a forked symfony standard?
I added you as a collaborator to my project, you can like this reproduce the error.
I got the invite but the link was a 404..
Sorry coming up in 5 min
Hi,
I have followed the whole installation (bundle in kernel, creation of the notFound and redirect entities + DB update, default config). My config is: zenstruck_redirect: redirect_class: AppBundle\Entity\Redirect not_found_class: AppBundle\Entity\NotFound model_manager_name: ~ remove_not_founds: true
As I understand one of my user falls on a 404 error, either the notfound DB will have a new row added to it or the user will be redirected to the right url included in my redirects. It does not do it.
For a new redirect, what is the exact code with parameters?
For an edit, symfony tells me: Could not load type "zenstruck_redirect" I am unsure of what that means.
Thanks a lot for your time and this awesome bundle!
Thanks