# |
Jun 22nd 2019, 19:01 |
madbbb |
I want to move all my events to listener class to keep all callbacks in one place. bootstrap.php: $invoices = TableRegistry::get('Invoices'); $invoiceListener = new InvoiceListener(); EventManager::instance()->attach($invoiceListener); invoicelistener.php: class InvoiceListener implements EventListenerInterface { public function implementedEvents() { return [ 'Model.beforeMarshal' => 'test', ]; } |
# |
Jun 22nd 2019, 18:52 |
Chetan |
Can anyone tell me, how to update cakephp 3.7.8 to 4.0 alpha 1 ? |
# |
Jun 22nd 2019, 18:48 |
chetanvarshney |
Please help me, How to Update cakephp 3.7.8 to 4.0 alpha1 ?? |
# |
Jun 22nd 2019, 18:47 |
chetanvarshney |
Hello |
# |
Jun 22nd 2019, 16:43 |
joey.mukherjee |
Maybe this is easier: ``` $query = $this->Projects->find ()->select (['name'])->contain (['Groups']) ->innerJoinWith ('Groups', function ($q) { return $q->where (['Groups.name' => 'public']); })->all ();``` How do I also add the groups the user is part of to this query? |
# |
Jun 22nd 2019, 16:37 |
joey.mukherjee |
I actually have both of them as "belongsToMany" since my users can be part of many groups and groups can have many users. But I guess what I am after is how to use "find" on something like this. Ideally, I want to join it with another table (Projects) but I can't even get the initial find to work. |
# |
Jun 22nd 2019, 16:25 |
admad |
GroupsUsers belongsTo Users and belongsTo Groups, then contain them |
# |
Jun 22nd 2019, 16:14 |
joey.mukherjee |
Can someone show me the CakePHP way of expressing this SQL statement: `select groups.id, groups.name from groups_users join users on users.id=groups_users.user_id join groups on groups.id=groups_users.group_id;` assuming I have my Model/Tables defined correctly? |
# |
Jun 22nd 2019, 14:16 |
Demeter |
Hello |
# |
Jun 22nd 2019, 12:08 |
slackebot1 |
for now |
# |
Jun 22nd 2019, 12:08 |
bgrinter |
@challgren thanks - we actually use CakePDF now. Its more a function of the engine, CakePdf uses dompdf, Tcpdf and WkHtmlToPdf among others. From what I've read I should look at Tcpdf We're on CakePHP 2.x and planning to migrate to 3 so there's a bit of a backlog - this is a feature that'll only be used by a handful of users (although a vocal handful) so I might put on the back burner now. There's other features that'll offer more benefit |
# |
Jun 22nd 2019, 11:59 |
challgren |
@bgrinter check out https://github.com/FriendsOfCake/CakePdf |
# |
Jun 22nd 2019, 11:13 |
bgrinter |
Hi all - I'm currently using dompdf to create PDF documents in an app for a volunteer run youth group. One form we create is a parent permission form for events and I've had a request to have a form that the parent can sign with a digital signature. dompdf doesn't support this - does anyone have any experience with other PDF engines? I've heard TCPDF supports it |
# |
Jun 22nd 2019, 07:06 |
madbbb |
Hello. I'm a little bit confused. When do you use CakePHP Event system and when model callbacks like afterSave? Should I put image uploading/processing in the event listener class when I save a post with an image attached to it? |
# |
Jun 22nd 2019, 00:30 |
joey.mukherjee |
I have a belongsToMany association (Users and Groups - users can belong to many groups and groups can have many users). can someone give me an example of how to query the groups based on the user id? |
# |
Jun 21st 2019, 23:30 |
rightscoreanalysis |
i did composer install before copying the site over |
# |
Jun 21st 2019, 23:29 |
challgren |
ahh `composer install` should fix that |
# |
Jun 21st 2019, 23:25 |
rightscoreanalysis |
thanks - it was the vendor directory which was wrong |
# |
Jun 21st 2019, 23:18 |
mrfeedback |
and you could try to change debug level. maybe you get some output what happens :slightly_smiling_face: |
# |
Jun 21st 2019, 23:16 |
mrfeedback |
is your documen root of the server set to webroot? and are you sure on your local install is mod_rewrite active? |
# |
Jun 21st 2019, 22:45 |
rightscoreanalysis |
any ideas? |
# |
Jun 21st 2019, 22:45 |
rightscoreanalysis |
i read the chapter on rewrites for apache |
# |
Jun 21st 2019, 22:45 |
rightscoreanalysis |
server logs empty |
# |
Jun 21st 2019, 22:45 |
rightscoreanalysis |
I have taken an old cake2 project form live environment, setup localhost version but when i try to open app it just hangs |
# |
Jun 21st 2019, 20:43 |
daniel.upshaw |
:slightly_smiling_face: |
# |
Jun 21st 2019, 19:27 |
joey.mukherjee |
Thanks for the suggestion Dan! It worked. I had a "Permission" config in my app.php which I had to take out for this to work. I'm not sure how I would have known that's what it was complaining about... |
# |
Jun 21st 2019, 19:03 |
joey.mukherjee |
Is that the only way? It gets pretty far in building the roles stuff, but right after the roles controller, it says "Bake is detecting possible fixtures..." and then craters. :( |
# |
Jun 21st 2019, 18:59 |
daniel.upshaw |
And then go through the install to try and find what's missing |
# |
Jun 21st 2019, 18:59 |
daniel.upshaw |
composer create-project --prefer-dist cakephp/app testingusersplugin |
# |
Jun 21st 2019, 18:59 |
daniel.upshaw |
I would start with |
# |
Jun 21st 2019, 18:59 |
daniel.upshaw |
Ah |
# |
Jun 21st 2019, 18:59 |
joey.mukherjee |
adding to an existing project. :( |
# |
Jun 21st 2019, 18:58 |
daniel.upshaw |
To try it |
# |
Jun 21st 2019, 18:58 |
daniel.upshaw |
I would start with a fresh one |
# |
Jun 21st 2019, 18:58 |
daniel.upshaw |
Or adding to an existing project? |
# |
Jun 21st 2019, 18:58 |
daniel.upshaw |
Are you using a fresh install? |
# |
Jun 21st 2019, 18:58 |
daniel.upshaw |
Most likely |
# |
Jun 21st 2019, 18:58 |
daniel.upshaw |
That is going to be a nightmare |
# |
Jun 21st 2019, 18:56 |
joey.mukherjee |
I am trying to use the acl plugin using this blog post: https://www.cakedc.com/roger_campanera/2018/01/26/integrating-users-and-acl-plugins-in-cakephp I am getting a Undefined property `Aros`. You have not defined the `Aros` association on `Cake\ORM\Table`. in [/web/geoviz2/vendor/cakephp/cakephp/src/ORM/Table.php, line 2533] error. I have the aros/acos tables, What am I missing? |
# |
Jun 21st 2019, 18:54 |
daniel.upshaw |
Also what's the point of disabling message deletion by author in the Slack chat? |
# |
Jun 21st 2019, 18:53 |
daniel.upshaw |
Crap, well it's the same issue though... doesn't seem to load custom finder from Behavior |