# |
Aug 20th 2019, 10:28 |
dereuromark |
you should always mention the cake version |
# |
Aug 20th 2019, 10:25 |
jiri.sejhar |
guys nobody answerd me is necesery do this array_merge($this->request->getData(), ['id'=>$item->id]) if i would get form data with id after insert save ? |
# |
Aug 20th 2019, 09:41 |
eax |
Hey folks! Cake3 question: I am setting up some Integration Tests, and I need to test a system that has a Shell/Command running in the background as a listener. Is there a way to start that Listener, and then run the rest of my tests? Thanks! |
# |
Aug 20th 2019, 09:37 |
dereuromark |
https://github.com/burzum/cakephp-service-layer |
# |
Aug 20th 2019, 09:37 |
dereuromark |
service layer :slightly_smiling_face: |
# |
Aug 20th 2019, 09:27 |
turkles |
I want to access some user data across controllers and some custom classes, possibly some Commands - where best to put it? |
# |
Aug 20th 2019, 09:26 |
neon1024 |
Or does compact take a variable name, I forget |
# |
Aug 20th 2019, 09:26 |
bernardine.ragas |
awww yeah, ill try |
# |
Aug 20th 2019, 09:25 |
neon1024 |
So you’ll have `compact($subject)` somewhere in the code |
# |
Aug 20th 2019, 09:25 |
neon1024 |
Undefined variable is self explanatory |
# |
Aug 20th 2019, 09:25 |
neon1024 |
Well compact is a php method used in cake to set variables to the view |
# |
Aug 20th 2019, 09:24 |
bernardine.ragas |
how do i fix this :slightly_smiling_face: please help |
# |
Aug 20th 2019, 09:24 |
neon1024 |
Audit stash! I might need that one later too. Good reminder |
# |
Aug 20th 2019, 09:24 |
bernardine.ragas |
Hi guys i have this problem, Undefined variable: subject [CORE/Cake/Utility/ObjectCollection.php, line 128 |
# |
Aug 20th 2019, 09:17 |
koeller |
I’m using muffin/footprint. I will have a further look into that. (y) |
# |
Aug 20th 2019, 09:17 |
admad |
Also checkout Lorenzo/audit-stash plugin |
# |
Aug 20th 2019, 09:16 |
admad |
There's muffin/footprint plugin for that |
# |
Aug 20th 2019, 09:14 |
koeller |
@admad: The idea with a behavior sounds good. Thanks. But my problem right now is to get the authed user. |
# |
Aug 20th 2019, 09:13 |
admad |
@koeller sounds good, though if you need to do so for multiple tables use a behavior |
# |
Aug 20th 2019, 09:10 |
koeller |
Hi everyone, I’ve got a question regarding logging of deleted entities. I would like to log the user who did the delete operation and call the log (with LogAwareTrait) in Table::afterDeleteCommit(). What would be the best way to get the user here? Thank you! |
# |
Aug 20th 2019, 09:10 |
val |
It looks like setting `defaultLocale` to `false` works |
# |
Aug 20th 2019, 09:09 |
admad |
The EAV i18n table is pretty in efficient anyway. But I guess switching to shadow table wouldn't be an option for you |
# |
Aug 20th 2019, 09:08 |
admad |
Just set a dummy language as default in the behaviour config and then all will go to the i18n table |
# |
Aug 20th 2019, 08:59 |
val |
We have all translations in i18n table including the default. Worked nicely in 2.x :( |
# |
Aug 20th 2019, 08:57 |
admad |
yes |
# |
Aug 20th 2019, 08:53 |
val |
Does TranslateBehavior expect to have the default translation for Post->title to be in posts table in 3.x? |
# |
Aug 20th 2019, 08:47 |
jiri.sejhar |
Hello all if i have $this-Model->save($item) How i get some associative array with data I have only object with protected _properties values... i need something like $this->request->getData() but with new id if i do insert values |
# |
Aug 20th 2019, 08:40 |
scuadra |
but it seems in Cake 3 is no longer available |
# |
Aug 20th 2019, 08:39 |
scuadra |
I think in Cake 2 it was possible to have something like that |
# |
Aug 20th 2019, 08:39 |
scuadra |
thank you |
# |
Aug 20th 2019, 08:39 |
scuadra |
all right |
# |
Aug 20th 2019, 08:37 |
dakota |
Simple fix is to change the association name in NewsArticle to `NewsImages` |
# |
Aug 20th 2019, 08:37 |
dakota |
@scuadra That error tells you what the problem is. You have two associations called "Images", but targeting different tables. |
# |
Aug 20th 2019, 08:33 |
dakota |
@bernardine.ragas I know it can cause a minor panic when all you get is a wall of text and errors, but always remember that most errors normally have some clue as to how to fix the issue, In 2.x it's normally not the first, or last error message shown, it is a lot better in CakePHP 3. But of course, if you get something that you are really stumped on, this channel is always here! |
# |
Aug 20th 2019, 08:31 |
dakota |
Awesome :slightly_smiling_face: |
# |
Aug 20th 2019, 08:29 |
bernardine.ragas |
thank you |
# |
Aug 20th 2019, 08:29 |
bernardine.ragas |
@dakota thanks it worked. and yeah, i am currently using what my company offers but eventually we will transition to the latest version. |
# |
Aug 20th 2019, 08:24 |
scuadra |
Also in NewsArticleImagesTable.php I have $this->setTable('news_images'); in initialize() method. |
# |
Aug 20th 2019, 08:23 |
slackebot |
NewsProducts.news_article_id'] ] ], 'conditions' => ['NewsProducts.product_id' => $product['id']], 'order' => ['NewsArticles.date' => 'desc', 'NewsArticles.created' => 'desc'], 'contain' => ['Images'], 'limit' => 12 ]; |
# |
Aug 20th 2019, 08:23 |
scuadra |
Here is my paginate: $this->paginate = [ 'fields' => [ 'NewsArticles.id', 'NewsArticles.title', 'NewsArticles.slug', 'NewsArticles.date', 'NewsArticles.content', 'NewsArticles.image' ], 'join' => [ [ 'table' => 'news_products', 'type' => 'INNER', 'alias' => 'NewsProducts', 'conditions' => ['NewsArticles.id = |
# |
Aug 20th 2019, 08:23 |
slackebot |
can't have an association of the same name with a different target "className" option anywhere in your app. |