Log message #4212356

# At Username Text
# Nov 5th 2019, 23:19 slackebot1 variable does have the contain ``` $query = $this->Table->find( 'all' ) ->contain( ['Table2'] ); ``` The contain also works if i remove my function from above (to show related information in my index page) but i dont know how i can perform a custom where in which both my tables are being searched with concatinated fields
# Nov 5th 2019, 23:19 slackebot1 ->like( $conc2, "%$search%" ) ->like( $conc3, "%$search%" ) ->like( $conc4, "%$search%" ); } ); } ``` But all I get is a ``` Column not found: 1054 Unknown column 'Table2.first_name' in 'where clause' ``` due to the fact, that the Query doesn't join. This functions resides in my index() function of my Table1Controller and the initialization of the $query
# Nov 5th 2019, 23:19 slackebot1 'Table2.last_name' => 'literal' ] ); $conc4 = $q->func() ->concat( [ 'Table2.last_name' => 'literal', ' ', 'Table2.first_name' => 'literal' ] ); return $exp->or( [ 'Table1.company LIKE'
# Nov 5th 2019, 23:19 slackebot1 => "%$search%", 'Table1.first_name LIKE' => "%$search%", 'Table1.last_name LIKE' => "%$search%", 'Table1.city LIKE' => "%$search%", 'Table2.first_name LIKE' => "%$search%", 'Table2.last_name LIKE' => "%$search%" ] ) ->like( $conc1, "%$search%" )
# Nov 5th 2019, 23:19 slackebot1 'Table1.last_name' => 'literal', ' ', 'Table1.first_name' => 'literal' ] ); // Concatenated EasybillCustomersContacts Name $conc3 = $q->func() ->concat( [ 'Table2.first_name' => 'literal', ' ',
# Nov 5th 2019, 23:19 slackebot1 */ // Concatenated EasybillCustomers Name $conc1 = $q->func() ->concat( [ 'Table1.first_name' => 'literal', ' ', 'Table1.last_name' => 'literal' ] ); $conc2 = $q->func() ->concat( [
# Nov 5th 2019, 23:19 kevin.pfeifer i try to do something like that ``` // Change query if a search parameter is given in GET data if ( $search ) { // Search for concat fields in cakephp >=3 // https://stackoverflow.com/questions/35405261/search-with-concat-fields-in-cakephp-3 $query->where( function( $exp, $q ) use ( $search ) { /** * @var QueryExpression $exp * @var Query $q
# Nov 5th 2019, 21:56 phantomwatson Ah, nevermind for my question. `Table::getDependent()` was right in front of me the whole time.
# Nov 5th 2019, 21:50 phantomwatson I might be misunderstanding what you're trying to do.
# Nov 5th 2019, 21:49 phantomwatson @kevin.pfeifer, does it work to specify a join and include the table name in the field name, e.g. `concat(['title' => 'Articles.title', 'author' => 'Authors.name'])`?
# Nov 5th 2019, 21:47 phantomwatson Does anyone happen to know how to query a table or entity and determine which associations are marked as dependent?
# Nov 5th 2019, 21:35 kevin.pfeifer i found that, but this only works for the same table https://stackoverflow.com/questions/35405261/search-with-concat-fields-in-cakephp-3
# Nov 5th 2019, 21:34 kevin.pfeifer someones know how I can use connected tables inside a custom QueryExpression for a concatenated where search?
# Nov 5th 2019, 21:23 daniel.upshaw Just getting used to the new folder structure... still confusing why it was searching in `src/` if the folder is moved
# Nov 5th 2019, 21:21 daniel.upshaw Yeah oddly it wanted to find that template in `src/templates`
# Nov 5th 2019, 21:17 daniel.upshaw Doesn't seem to be `paths.php`
# Nov 5th 2019, 21:14 daniel.upshaw That's probably it lol
# Nov 5th 2019, 21:14 daniel.upshaw I'll make sure my config files are up-to-date with 4
# Nov 5th 2019, 21:12 daniel.upshaw Where core and pages are basic plugins
# Nov 5th 2019, 21:12 daniel.upshaw ```Error: [Cake\View\Exception\MissingTemplateException] Template file 'Error/error500.php' could not be found. The following paths were searched: - core/src/templates/plugin/Pages/ - pages/templates/ - core/src/templates/ - vendor/cakephp/cakephp/templates/ ```
# Nov 5th 2019, 21:11 daniel.upshaw I noticed sometimes it searches for templates in `src/templates`, and sometimes `templates`
# Nov 5th 2019, 21:11 daniel.upshaw Jumping onto Cake4 :slightly_smiling_face:
# Nov 5th 2019, 17:35 karmicdice Adios! Thanks for being patient... just learning my way to contrib more to the framework in near future. :slightly_smiling_face: Learning...
# Nov 5th 2019, 17:33 karmicdice Haha! It is close to mid-night here, just wanted to be quick.
# Nov 5th 2019, 17:33 dereuromark Didnt want to Force push?^^
# Nov 5th 2019, 17:32 karmicdice https://github.com/cakephp/cakephp/pull/13843
# Nov 5th 2019, 17:31 karmicdice @dereuromark Yep. Took a backup and made a new PR. Discarded the previous branch.
# Nov 5th 2019, 17:30 karmicdice Yes Windows. I have PhpStorm on Windows... but setting up stuff was taking up time.
# Nov 5th 2019, 17:11 dereuromark I used to do this via Windows Tortoise Git with single clicks too back many years ago, since Linux I only use CLI these days, I might also have to check the PHPStorm GUI here (again) some day.
# Nov 5th 2019, 17:11 dereuromark @karmicdice Make sure you got a backup branch stored away just in case, then even if things go boom, you can recover and restart without having lost all the changes, once you (accidently or on purpose) then force push to upstream.
# Nov 5th 2019, 16:36 karmicdice PhpStorm. ! I have that.! Let me check
# Nov 5th 2019, 16:36 ndm Ever since PhpStorm I've never manually used the Git CLI for rebasing again :upside_down_face:
# Nov 5th 2019, 16:36 ndm Rebasing can mess up things quite easily if you're making a mistake, if you're getting 4.x stuff, then you probably rebased onto the wrong branch.
# Nov 5th 2019, 16:28 karmicdice Cool then!
# Nov 5th 2019, 16:28 karmicdice Maybe you cannot read either.
# Nov 5th 2019, 16:28 karmicdice I just mentioned it is taking up history from 4.x
# Nov 5th 2019, 16:28 admad I never said i could be
# Nov 5th 2019, 16:27 karmicdice I am not sure if you can be of any help.
# Nov 5th 2019, 16:27 admad I don't know what mess you created :slightly_smiling_face: My commits shouldn't show up in the changes i have added
# Nov 5th 2019, 16:26 karmicdice @admad Currently it is showing me a massive Mailer change which has your sig on it... Obviously, higher chances of conflicts. Any idea about how I could rebase to only 1 branch? It is taking up history from 4.x
# Nov 5th 2019, 16:25 hello518 Ahhh gross -- Thanks for the information, helpful!