# |
Apr 19th 2021, 17:49 |
Bob21 |
and my response is looking for the /json/[action]/update.php |
# |
Apr 19th 2021, 17:48 |
Bob21 |
$this->viewBuilder()->setOption('serialize', 'data'); |
# |
Apr 19th 2021, 17:48 |
Bob21 |
$this->set('data', $data); |
# |
Apr 19th 2021, 17:48 |
Bob21 |
$data = ["error"=>"<span class='error'><strong>Error!</strong> Action not permitted!</span>"]; |
# |
Apr 19th 2021, 17:47 |
Bob21 |
$this->viewBuilder()->setOption('serialize', 'data'); |
# |
Apr 19th 2021, 17:47 |
Bob21 |
$this->set('data', $data); |
# |
Apr 19th 2021, 17:47 |
Bob21 |
$data = ["error"=>"<span class='error'><strong>Error!</strong> Action not permitted!</span>"]; |
# |
Apr 19th 2021, 17:47 |
Bob21 |
This function returns blank in my ajax request |
# |
Apr 19th 2021, 17:46 |
Bob21 |
I have a problem with Using Data Views with the Serialize Key |
# |
Apr 19th 2021, 17:45 |
Bob21 |
Hello |
# |
Apr 19th 2021, 17:30 |
cnizzardini |
I don't have any experience with migration templates. Have you looked at the closed/open issues on https://github.com/cakephp/migrations/issues ? |
# |
Apr 19th 2021, 15:09 |
slackebot |
`plugins/MyTheme/templates/bake`, if doing something like `bin/cake bake migration CreateFoo -t MyTheme`. It's not like themes for migrations are silently deprecated or something? ,:) |
# |
Apr 19th 2021, 15:09 |
slackebot |
alltogether; the TemplateRenderer does not get a theme sent to the constructor, the template given to `$renderer->generate()` in the bake command is a hardcoded `Migrations.config/skeleton` , which cannot be changed since you'll immediately get errors for non-existing templates. Before I go even further down the rabbit hole; baking migrations _should_ still support themes, right? And those files should be located in |
# |
Apr 19th 2021, 15:09 |
tunafish |
Hi! We upgraded our API to Cake4.x last year, but at the time couldn't get our theme for baking migrations working again. We left it alone then, because other issues and stuff, but we still really would like to have our theme back. So, we updated the templates and placed them in the appropriate location, but it never works. I dove into the code of `cakephp/migrations` itself, and it looks like it's just ignoring themes |
# |
Apr 19th 2021, 14:38 |
jotpe |
@greg138 yes, it extends \Cake\ORM\Table and just add the `@property \Queue\Model\Table\QueuedJobsTable $QueuedJobs` produces the phpstan message above. |
# |
Apr 19th 2021, 14:32 |
greg138 |
Should just be `@property \Queue\Model\Table\QueuedJobsTable`, then? |
# |
Apr 19th 2021, 14:20 |
kevin.pfeifer |
https://github.com/dereuromark/cakephp-queue/blob/master/src/Model/Table/QueuedJobsTable.php yes it does |
# |
Apr 19th 2021, 14:17 |
greg138 |
Does QueuedJobsTable extend Cake\ORM\Table? |
# |
Apr 19th 2021, 13:44 |
jotpe |
When I change the property like above PHPStorm does not resolve methods from the QueuedJobsTable: `phpstan: Call to an undefined method Cake\ORM\Table::createJob().` |
# |
Apr 19th 2021, 13:38 |
cnizzardini |
`* @property \Queue\Model\Table\QueuedJobsTable|\Cake\ORM\Table $QueuedJobs` |
# |
Apr 19th 2021, 13:37 |
cnizzardini |
If you are saying it can be this or that |
# |
Apr 19th 2021, 13:37 |
cnizzardini |
Use a `|` |
# |
Apr 19th 2021, 13:31 |
jotpe |
Hey guys. What's the correct annotation of a Model. e.g. I load models via: ```$this->QueuedJobs = $this->getTableLocator()->get('Queue.QueuedJobs');``` and tried to annotate it with: ``` * @property \Queue\Model\Table\QueuedJobsTableand\Cake\ORM\Table $QueuedJobs``` but phpstan is complaining: `phpstan: Property Memberships\Model\Table\PeriodsTable::$QueuedJobs (Queue\Model\Table\QueuedJobsTable) does not accept Cake\ORM\Table.` |
# |
Apr 19th 2021, 03:06 |
admad |
https://book.cakephp.org/4/en/core-libraries/httpclient.html#namespace-Cake\Http\Client |
# |
Apr 19th 2021, 00:36 |
davinci |
This is what I get when I debug `$response`: |
# |
Apr 19th 2021, 00:28 |
davinci |
Am I missing something obvious? |
# |
Apr 19th 2021, 00:28 |
davinci |
Trying to use `$http->get()` , which seems fine, but when I try to use the suggested `$response->body()`, I get this error: `Call to undefined method Cake\Http\Client\Response::body()` |
# |
Apr 18th 2021, 21:46 |
kevin.pfeifer |
i guess the solution from cakedc/users is the best way https://github.com/CakeDC/users/blob/master/src/View/Helper/AuthLinkHelper.php |
# |
Apr 18th 2021, 20:07 |
kevin.pfeifer |
or do i have to check that myself before in the controller and pass that data to the view |
# |
Apr 18th 2021, 20:06 |
kevin.pfeifer |
But keeping on the authorization plugin: Is there a way in the template to check if the current user is allowed to perform a specific action? In the “old” ACL days i remember doing something like ```$this->Acl->link(__('Edit'), ['action' => 'edit', $user->id])``` So there was a separate Acl Helper for the view. |
# |
Apr 18th 2021, 17:18 |
kevin.pfeifer |
if so, i would highly recommend you to go through the authorization tutorial here and you will probably get how the whole auth system comes together https://book.cakephp.org/4/en/tutorials-and-examples/cms/authorization.html |
# |
Apr 18th 2021, 17:17 |
kevin.pfeifer |
I have not yet used the CRUD plugin but do you have “normal” controller functions where you get into after calling a CRUD URL of your choice? |
# |
Apr 18th 2021, 15:28 |
noel |
How can I use Authorization plugin with friends-of-cake/CRUD? |
# |
Apr 18th 2021, 14:42 |
me1367 |
Ah okeay, thanks. |
# |
Apr 18th 2021, 14:40 |
ndm |
@me1367 You cannot trigger `E_WARNING`, that's for PHP internal code, userland code can only trigger `E_USER_*`. |
# |
Apr 17th 2021, 19:40 |
me1367 |
Quick question. When I inform the developer that a value is "wrong" (in my case an expiry of `0` or a negative value), would it be better practice to throw a `E_USER_WARNING` or `E_WARNING`? |
# |
Apr 17th 2021, 11:49 |
isvyas |
You can use mailtrap too. https://mailtrap.io/ |
# |
Apr 16th 2021, 22:01 |
slackebot |
`$this->setTable('tablename')`. |
# |
Apr 16th 2021, 22:01 |
ndm |
The join table and the target table would need to be in the same database in order for this to work with multiple connections, as they are both being retrieved together via joining. If the join table needs to be in a different DB, then your best chance is to modify the table name config of your table classes in case your DBMS supports cross DB communication, ie `$this->setTable('dbname.tablename')` instead of |
# |
Apr 16th 2021, 21:58 |
ron.rattie |
well you have described what I have setup so far |
# |
Apr 16th 2021, 21:55 |
kevin.pfeifer |
sorry, never done that/needed that till now but i guess you would have to 1. have both database connections set in your config/app_local.php and 2. somehow set the "non default" connection to be used inside your model where it should connect to the other database But i have no idea how |