# |
Sep 9th 2019, 13:49 |
itmpls |
I have 2 database connections and I am pulling data from both. Doing a `foreach ($connections as $connection) { $table->setConnection($connection); $table->find()->contain('Bar'); });` but when I contain `Bar` Cake does a `SHOW FULL COLUMNS FROM Bar` on the *default* connection and an error is thrown because it doesn't check that table on the dynamic connection I set |
# |
Sep 9th 2019, 13:47 |
ndm |
I don't really know what exactly you mean by that? Reverting what exactly? And what is "all the other stuff"? |
# |
Sep 9th 2019, 13:44 |
itmpls |
just came across this which may solve my problem |
# |
Sep 9th 2019, 13:44 |
itmpls |
@ndm - in your answer here, https://stackoverflow.com/a/48372895/145190 is there a way to revert connection to default after all the other stuff? |
# |
Sep 9th 2019, 13:39 |
y_lin |
@ndm Thanks a lot. I will try it! |
# |
Sep 9th 2019, 13:36 |
ndm |
@y_lin That's the security component, it has nothing to with CSRF, it handles stuff like form tampering protection. If you don't need that kind of protection for your AJAX requests, the most simple solution is to disable it for those specific actions. Otherwise you'd also have to generate and add a security token to your AJAX requests. See for example how `\Cake\View\Helper\FormHelper::secure()` is doing that. |
# |
Sep 9th 2019, 13:34 |
itmpls |
I think this is . the same problem I'm having |
# |
Sep 9th 2019, 13:34 |
itmpls |
https://stackoverflow.com/questions/5313748/how-can-i-eliminate-cakephps-show-full-columns-queries |
# |
Sep 9th 2019, 13:28 |
y_lin |
this is the error message i got |
# |
Sep 9th 2019, 13:27 |
y_lin |
@ndm Thank you for giving suggestions. I think that i didn't explain the problem i meet clearly. |
# |
Sep 9th 2019, 13:26 |
challgren |
@m4ximum take a look at https://github.com/CakeDC/auth/tree/master/src/Rbac |
# |
Sep 9th 2019, 13:24 |
itmpls |
and that obviously doesn't work because i'm setting it dynamically |
# |
Sep 9th 2019, 13:24 |
itmpls |
the problem is, when it does that `SHOW FULL COLUMNS FOR table` it does it on the default connection |
# |
Sep 9th 2019, 13:22 |
itmpls |
Does anyone know why my query in which I set the connection of a table dynamically using setConnection, when I specify a table in `contains()`, cake does a `SHOW FULL COLUMNS FOR table`? Do I need to override and reset the global connection? debug is true I believe |
# |
Sep 9th 2019, 13:19 |
aivaras.godliauskas |
thanks. |
# |
Sep 9th 2019, 13:13 |
m4ximum |
Thank you for the answer @ndm. Right now with my cakephp 2 application I can grant permissions for every single controller action and group them as roles. Is this possible with this authorization plugin ? |
# |
Sep 9th 2019, 13:03 |
ndm |
@m4ximum You should look into https://github.com/cakephp/authorization, it's flexible enough so that you can create ACL in pretty much any way you like. |
# |
Sep 9th 2019, 12:53 |
m4ximum |
Hi all, is there any possibility to deal with ACLs in cakephp 4 ? Or is there some equivalent that I’ve not figured out yet ? |
# |
Sep 9th 2019, 12:46 |
ndm |
@y_lin Start with inspecting the stacktrace to figure from where exactly the error is thrown. It also helps if you post the _exact_ error message, there are various possible errors related to tokens. |
# |
Sep 9th 2019, 12:43 |
y_lin |
Hi, I want to delete or add entity by ajax with csrf. Does anyone knows how to deal with it. I have already added 'X-CSRF-Token' in the header of the request. |
# |
Sep 9th 2019, 12:43 |
ndm |
@arai.mio.i As of 3.8 you can for example add custom locations via `\Cake\ORM\Locator\TableLocator::addLocation()`, like `$this->getTableLocator()->addLocation('Model/Table/User')` or `\Cake\ORM\TableRegistry::getTableLocator()->addLocation('Model/Table/User')` from wherever `\Cake\ORM\Locator\LocatorAwareTrait` cannot be used. |
# |
Sep 9th 2019, 12:11 |
arai.mio.i |
Hi. I want to make directories under Table. The table classes under the directories can be load as below but are there any way to omit the namespace in the same way as default? ``` $this->loadModel('App\Model\Table\User\UsersTable') ``` |
# |
Sep 9th 2019, 12:01 |
lorenzo |
@aivaras.godliauskas check the `modifier()` method in the query api |
# |
Sep 9th 2019, 11:15 |
neon1024 |
Afternoon everyone :wave: |
# |
Sep 9th 2019, 11:13 |
aivaras.godliauskas |
Hi, is it possible to use SQL_CACHE in cakephp ORM query? |
# |
Sep 9th 2019, 11:11 |
dereuromark |
Jep. If sth is not clear in docs or code, please pr suggested Improvements. |
# |
Sep 9th 2019, 10:55 |
COOurb |
and after creating app_queue.php I have to add 'workermaxruntime' option. |
# |
Sep 9th 2019, 10:54 |
COOurb |
Tasks added, but never ran |
# |
Sep 9th 2019, 10:54 |
COOurb |
Also, task-file requires this line 'use Queue\Shell\Task\QueueTaskInterface;' Without this line it doesn't work |
# |
Sep 9th 2019, 10:53 |
COOurb |
so if I don't have access to server itself - I can't use this plugin |
# |
Sep 9th 2019, 10:52 |
COOurb |
ok, dude, I already got that I have to run worker from outside |
# |
Sep 9th 2019, 10:23 |
dereuromark |
Also read up on how php and cakephp works, as this is a key requirement to understanding also any plugin and how their things work. |
# |
Sep 9th 2019, 10:22 |
dereuromark |
what part of the documented link https://github.com/dereuromark/cakephp-queue/tree/master/docs is not clear? |
# |
Sep 9th 2019, 10:18 |
COOurb |
Where I can found normal documents about it or another defered tasks plugin? |
# |
Sep 9th 2019, 10:17 |
COOurb |
ok, Queue plugin isn't working "Expected configuration key "Queue.workermaxruntime" not found." |
# |
Sep 9th 2019, 09:55 |
neon1024 |
Wait and see what they do with the squad for the Oval test |
# |
Sep 9th 2019, 09:55 |
neon1024 |
Jason Roy has been rather exposed at Test level though, I feel for him a bit |
# |
Sep 9th 2019, 09:54 |
neon1024 |
At least Burns and Denly look like they might be able to solve the top order batting issue |
# |
Sep 9th 2019, 09:54 |
admad |
he was the difference between the 2 teams when India toured |
# |
Sep 9th 2019, 09:54 |
neon1024 |
I’d agree with you there @admad |
# |
Sep 9th 2019, 09:54 |
neon1024 |
Well yeah, however you feel about him, I don’t think him missing out due to injury was the way to go |