Log message #4261504

# At Username Text
# Apr 19th 2021, 19:08 kevin.pfeifer or create a trait
# Apr 19th 2021, 19:08 kevin.pfeifer you could also create a `BasePolicy` which your needed Policies extend from
# Apr 19th 2021, 19:07 sebastiansperandio093 you could add a custom finder and get other data related to the user
# Apr 19th 2021, 19:02 hello106 Thank you @kevin.pfeifer - if its only looking at the User Identity, is that still where you would add it? (for info, it would all be based on the users role only)
# Apr 19th 2021, 19:00 kevin.pfeifer use a utility class
# Apr 19th 2021, 18:52 hello106 Would anyone have any advice on where best to put a function used across various entity policies (we’re using the Cake Authorization plugin)? Like the `isAuthor()` in the example https://book.cakephp.org/4/en/tutorials-and-examples/cms/authorization.html#creating-our-first-policy but that can be defined once and then used in multiple policy?
# Apr 19th 2021, 18:46 sebastiansperandio093 'serialize', ['data']
# Apr 19th 2021, 18:45 sebastiansperandio093 just in case, could you try to pass the second parameter as an array?
# Apr 19th 2021, 18:45 rightscoreanalysis ah: $this->request->getParam('controller')
# Apr 19th 2021, 18:44 rightscoreanalysis how can i get the current controller in v4, in 3 this worked $this->request->params['controller']
# Apr 19th 2021, 18:43 sebastiansperandio093 mmm
# Apr 19th 2021, 18:15 Bob21 still no response
# Apr 19th 2021, 18:14 Bob21 I will try that
# Apr 19th 2021, 18:11 sebastiansperandio093 did you trying removing html code from data?
# 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()`