# |
Jul 26th 2021, 15:09 |
birdy247 |
InsurancePoliciesRegistrationCategories table doesnt exist |
# |
Jul 26th 2021, 15:09 |
birdy247 |
We are using cake magic to handle the join table |
# |
Jul 26th 2021, 15:08 |
birdy247 |
Because RegistrationCategories BelongToMany InsurancePolicies |
# |
Jul 26th 2021, 15:08 |
birdy247 |
You are required to select the "InsurancePoliciesRegistrationCategories.registration_category_id" |
# |
Jul 26th 2021, 15:08 |
birdy247 |
We then get this message |
# |
Jul 26th 2021, 15:07 |
birdy247 |
```'RegistrationCategories.InsurancePolicies' => [ 'fields' => [ 'id', 'name', 'confirmation_email_text', 'registration_category_id' ] ],``` |
# |
Jul 26th 2021, 15:07 |
birdy247 |
This is in a contain |
# |
Jul 26th 2021, 15:07 |
birdy247 |
We are hitting a weird issue with selecting data in queries |
# |
Jul 26th 2021, 15:07 |
birdy247 |
Hi |
# |
Jul 26th 2021, 14:01 |
paolo.bragagni |
it fallback to default page seems ok |
# |
Jul 26th 2021, 13:26 |
kevin.pfeifer |
the referrer is set by the browser but is not always present (see https://stackoverflow.com/questions/6880659/in-what-cases-will-http-referer-be-empty) Therefore you should always have a safety fallback which you should use if the referrer is not present |
# |
Jul 26th 2021, 13:21 |
paolo.bragagni |
(same problem here..) |
# |
Jul 26th 2021, 13:20 |
paolo.bragagni |
hi sometimes $a=$request->referer(); doesnt setted |
# |
Jul 26th 2021, 12:34 |
paolo.bragagni |
Better (hope to did it in the righrt way) ... |
# |
Jul 26th 2021, 12:32 |
brandon |
@admad turns out, I never updated the `->add(new ErrorHandlerMiddleware())` in Application.php to match the signature of the the 4.x signature. I had to disable DebugKit to see the actual error for some reason. Fixed this and the error went away. |
# |
Jul 26th 2021, 12:29 |
paolo.bragagni |
eureka |
# |
Jul 26th 2021, 12:24 |
paolo.bragagni |
return request->referer(); in getUrl ? |
# |
Jul 26th 2021, 12:15 |
paolo.bragagni |
or redirect to the 'previuos page'? |
# |
Jul 26th 2021, 12:14 |
paolo.bragagni |
in handle function inside an Handler how not redirect ? |
# |
Jul 26th 2021, 11:20 |
admad |
@brandon you most likely have recursive errors, stick a `dd($exception)` in this method https://github.com/cakephp/cakephp/blob/cdcf54e33b860aa285c6ee9ba2e94d976fd3bdff/src/Error/Middleware/ErrorHandlerMiddleware.php#L141 |
# |
Jul 26th 2021, 10:10 |
soupaahh |
do someone have any idea on why this is occurring ? |
# |
Jul 26th 2021, 10:09 |
soupaahh |
when i point to admin/controllerA/edit/1 the form is well displayed with magicfields and update/patchEntity is not working |
# |
Jul 26th 2021, 10:09 |
soupaahh |
when i point to controllerA/edit/1 the form is well displayed with magicfields and update/patchEntity is working |
# |
Jul 26th 2021, 10:08 |
soupaahh |
boths controllers have edit method with the same code |
# |
Jul 26th 2021, 10:08 |
soupaahh |
i have a Controller A and the same but in a different namespace because of routing prefix |
# |
Jul 26th 2021, 10:07 |
soupaahh |
Hi guys ! |
# |
Jul 26th 2021, 07:47 |
paolo.bragagni |
and it works |
# |
Jul 26th 2021, 07:47 |
paolo.bragagni |
```$service->setConfig([ 'unauthenticatedRedirect' => Router::url([ 'prefix' => false, 'plugin' => null, 'controller' => 'Users', 'action' => 'login', ]), 'queryParam' => 'redirect', ]);``` |
# |
Jul 26th 2021, 07:46 |
paolo.bragagni |
in getAuthenticationService I use the redirection in this way |
# |
Jul 26th 2021, 07:46 |
paolo.bragagni |
and it miss the 'cake4new' part |
# |
Jul 26th 2021, 07:45 |
paolo.bragagni |
trying to debug $Url=Router::url('/', true); before the $middlewareQueue->add(new AuthorizationMiddleware($this, [ 'requireAuthorizationCheck' => false, |
# |
Jul 26th 2021, 07:44 |
paolo.bragagni |
and .. first of all I dont see the right Url that should be https://cakephp.local/cake4new/ etc |
# |
Jul 26th 2021, 07:43 |
paolo.bragagni |
when a user is not authorized redirectUrl goes to https://cakephp.local/login?redirect=%2Flibri%2Fadd |
# |
Jul 26th 2021, 07:42 |
paolo.bragagni |
but got some problems |
# |
Jul 26th 2021, 07:42 |
paolo.bragagni |
trying to reproduce https://github.com/LordSimal/authorization/blob/master/docs/en/middleware.rst#how-to-create-a-custom-unauthorizedhandler |
# |
Jul 26th 2021, 07:38 |
brandon |
I don't think throwing more memory at a memory leak/loop is helpful in this situation. |
# |
Jul 26th 2021, 07:29 |
itsolution1014 |
Please try to add this code. |
# |
Jul 26th 2021, 07:29 |
itsolution1014 |
```ini_set('memory_limit', '1024M');``` You can fix that issue with this code. |
# |
Jul 26th 2021, 07:24 |
slackebot2 |
troubleshoot this issue. Any assistance would be greatly appreciated. |
# |
Jul 26th 2021, 07:24 |
brandon |
Hello, all. I am still working my way through upgrading from 3.x to 4.x. I have fixed all issues with phpstan, phpcs and rector prior to updating dependencies. I have cakephp updated to 4.0.10 (stepping up incrementally) and seem to have hit a memory leak or infinite loop. I am loading the home page and am getting `Allowed memory size of 134217728 bytes exhausted (tried to allocate 20480 bytes)`. I don't know where to start to |
# |
Jul 26th 2021, 04:32 |
arthurb |
Got it! using query ```->query('ALTER TABLE `invoices` auto_increment = 2000;')``` |