Log message #4108530

# At Username Text
# Jan 11th 2018, 16:59 Es0teric ah i see
# Jan 11th 2018, 16:58 bigdaddygee die stop all process (including rendering)
# Jan 11th 2018, 16:58 bigdaddygee instead of die use return;
# Jan 11th 2018, 16:56 Es0teric i also have a die(); after
# Jan 11th 2018, 16:56 Es0teric but its not rendering
# Jan 11th 2018, 16:56 Es0teric i have this: if( !is_null( $existingUser ) ) { $this->render('HCConfirmer.HCConfirmers/display_merge'); }
# Jan 11th 2018, 16:55 bigdaddygee https://book.cakephp.org/2.0/en/controllers.html#rendering-a-specific-view
# Jan 11th 2018, 16:54 Es0teric question -- if i am in a controller on cake 2.x, how do i render a different view without allowing the controller to continue going to the default behavior?
# Jan 11th 2018, 16:51 slackebot acceptable answer. after all, i'm not the one asking the question ;)
# Jan 11th 2018, 16:51 bigdaddygee Part of the problem right now is that you use word.word as key, and I think that inflector do not like it and that's why it's not working. I asked you the fieldName in your table ta refer to your tags id, and you where not able to tell me. So that's why I invite you to use bake, it will prepare the code for you, and you'll be able to understand what's going on. But that's your call if you think that i'm not good enough to point you to an
# Jan 11th 2018, 16:49 bigdaddygee And you'll see
# Jan 11th 2018, 16:49 bigdaddygee it will do it for you
# Jan 11th 2018, 16:49 bigdaddygee ... if you do use bake
# Jan 11th 2018, 16:49 pedroseco thanks :slightly_smiling_face:
# Jan 11th 2018, 16:48 pedroseco Will read the documentation on that part to find if it's true.
# Jan 11th 2018, 16:48 pedroseco not the issue I think. belongsToMany probably need a custom validation rule, that's all I was going to ask.
# Jan 11th 2018, 16:46 bigdaddygee Have you ever tried bake ?
# Jan 11th 2018, 16:46 pedroseco I think the schema is not the problem
# Jan 11th 2018, 16:45 pedroseco yes
# Jan 11th 2018, 16:44 bigdaddygee Two things, have you done your relations in db ? (foreign key) ?
# Jan 11th 2018, 16:44 bigdaddygee I have an idea for you
# Jan 11th 2018, 16:44 bigdaddygee Wait wait wait...
# Jan 11th 2018, 16:44 bigdaddygee And what's the structure of posts
# Jan 11th 2018, 16:43 pedroseco so it should be straight forward. At least there is no problem at all on saving data. I was just trying to use the validator, and only now noticed the difficulty
# Jan 11th 2018, 16:43 pedroseco posts | tags | posts_tags
# Jan 11th 2018, 16:41 bigdaddygee outside cakephp
# Jan 11th 2018, 16:41 bigdaddygee What's your table schema
# Jan 11th 2018, 16:41 pedroseco since its a belongsToMany if I use just "tags" it won't work. We need to use the "._ids" so it gets associated
# Jan 11th 2018, 16:40 bigdaddygee how do you call that fieldName where you want the tag id to be save
# Jan 11th 2018, 16:40 bigdaddygee in that db table
# Jan 11th 2018, 16:40 pedroseco shouldn't the fieldName be tags._ids ?
# Jan 11th 2018, 16:39 pedroseco i tried with $validator->notEmpty('tags._ids') too but no luck
# Jan 11th 2018, 16:39 bigdaddygee if yes, just use it like that : `echo $this->Form->control('fieldName', ['options' => $tags._id]);` then you will able to validate fieldName
# Jan 11th 2018, 16:39 pedroseco yes
# Jan 11th 2018, 16:38 bigdaddygee So tags._ids return a select ?
# Jan 11th 2018, 16:36 pedroseco @bigdaddygee So i have this on the form side: $this->Form->control('tags._ids') (its a belongsToMany) and I was trying to validate the notEmpty rule with: $validator->notEmpty('tags')
# Jan 11th 2018, 16:34 bigdaddygee @pedroseco any code sample ? would be easier :slightly_smiling_face:
# Jan 11th 2018, 16:33 pedroseco Hi guys, quick question: On the table $validator, how do I validate a belongsToMany field? (in my case the model name is Tags) Tested with ->requirePresence('tags').. or notEmpty('tags') but no good.
# Jan 11th 2018, 16:31 bigdaddygee *** hide him face in a paper bag ***
# Jan 11th 2018, 16:31 bigdaddygee Wow... i'm dump... Why should I verify anything... it happen AFTER DELETE... So just clear the cache -.- sorry...
# Jan 11th 2018, 16:30 bigdaddygee Hi folks ! :slightly_smiling_face: I'm new with caching in Cake, and I found in doc afterSave to check if entity is new then clear the cache accordingly, I would like to do the same on delete, but there's no doc for afterDelete nor for the entity method (like $entity->isNew()) Someone can help me with that ?