Log message #4261694

# At Username Text
# Apr 22nd 2021, 19:13 kevin.pfeifer https://book.cakephp.org/4/en/orm/database-basics.html#configuration https://www.php.net/manual/en/pdo.constants.php
# Apr 22nd 2021, 19:13 kevin.pfeifer there is also a `flags` key in the connection config where you can define PDO configs like this ```PDO::CASE_LOWER (int) Force column names to lower case.```
# Apr 22nd 2021, 19:12 admad @mehov `bake` or the cakephp cli in general is meant for the app not plugin. Copying over the files won't work either.
# Apr 22nd 2021, 19:12 ndm If you do `$query->sql()` what do you get?
# Apr 22nd 2021, 19:12 umer936 yes bc it changes if I change the order by or where
# Apr 22nd 2021, 19:11 ndm *are you sure
# Apr 22nd 2021, 19:11 ndm Are you it's from that specific query? Check the stracktrace in your logs from what query exactly this is being triggered.
# Apr 22nd 2021, 19:10 umer936 bc i get (in DebugKit Log), Undefined column: 7 ERROR: column engineerings.sutc does not exist (when i passed in SUTC)
# Apr 22nd 2021, 19:07 umer936 Huh.
# Apr 22nd 2021, 19:02 ndm @umer936 I've tried it with Postgres right now, and it works fine, the generated SQL keeps the case as passed to the query, neither does it remove manual quotes, nor does it change the case. :thinking_face:
# Apr 22nd 2021, 19:01 mehov Thank you for confirming. This is inside your standalone plugin, correct? Did you manually copy your bin folder into your plugin from elsewhere, or was it installed automatically?
# Apr 22nd 2021, 18:58 mehov Hi everyone! I baked a plugin and moved it outside of my CakePHP 4 app, so now it's standalone. Am I supposed to be able to cd into the plugin folder and run `bin/cake bake model etc.`? I made sure plugin's composer installed the bake and the actual cakephp into plugin's vendor folder
# Apr 22nd 2021, 18:51 umer936 Positive. If I run `bin/cake version` , i get 4.2.5
# Apr 22nd 2021, 18:50 ndm Are you sure that you're on 4.2.5 in the environment where you're testing this?
# Apr 22nd 2021, 18:49 umer936 Hmm
# Apr 22nd 2021, 18:49 umer936 Using the ->where() or ->select() methods also strips the quote marks, which is why im specifying them in the array
# Apr 22nd 2021, 18:48 ndm This should have been fixed somewherere in 4.1 IIRC, and a quick test shows that it works.
# Apr 22nd 2021, 18:47 umer936 I'm using CakePHP 4.2.5
# Apr 22nd 2021, 18:46 ndm Well, that's conditions, not fields ;) Yeah, that was fixed in recent CakePHP 4.x. If you can't upgrade yet, you should be able to workaround it by using expressions
# Apr 22nd 2021, 18:46 umer936 i solved the above by making it `['"SUTC" >=' => 300]`
# Apr 22nd 2021, 18:46 umer936 basically anywhere i try to use the column name is an issue
# Apr 22nd 2021, 18:43 umer936 ```$this->ModelName->find('all',```
# Apr 22nd 2021, 18:42 ndm @umer936 Do you have an example to reproduce this? I don't remember CakePHP ever changing the case of fields in the select list.
# Apr 22nd 2021, 18:27 slackebot `'fields'` bc it removes the quote marks. How should I be going about this? I see there's `quoteIdentifier` in `SqlDialectTrait.php` , or is there a better way?
# Apr 22nd 2021, 18:27 umer936 Hello. I'm having trouble with running queries on tables in a Postgres DB. The DB (which I can't change) has the column names in caps. (eg: "COLNAME") So if I do a `find('all', ['fields' => $parameters]);` (with `$parameters` being array of column names), the query that gets run searches for a lowercase colname (which fails). I "fixed" this elsewhere by wrapping `'conditions'` values with " quote marks, but that fails for
# Apr 22nd 2021, 16:46 marek.sebera Yup, but the extended deadline is something i personally very appreciate
# Apr 22nd 2021, 16:21 admad I hope you are still working on upgrading to 4.x :)
# Apr 22nd 2021, 15:52 marek.sebera Y'all who maintain and contribute to the CakePHP project, thank you very much for your efforts, now this goes specifically to whomever decided that both 3.x bug and security support will be extended to 15/Dec/2021 through 3.10.x releases, big ups!
# Apr 22nd 2021, 15:28 slackebot `*JoinWith()` methods are really just the tad more convenient variant of manual joins, and using custom aliases is the compromise that allows you to inject data and avoid the matching data structure.
# Apr 22nd 2021, 15:28 ndm @v.plancher Under the hood `leftJoinWith()` uses the same mechanics as `matching()`, with the only difference being that the former will not modify the select list. Injecting the matched results into the regular structure as known from contain, could cause quite some problems, as there will always be only one associated result per record (even if you are using grouping), which could then be quite confusing for people. the
# Apr 22nd 2021, 15:14 v.plancher But I don't want to correct every request that return these datas, I'm trying to return them inside the user entity, like it was before, like if nothing changed. I wanted to just add a custom finder on the requests that need it to do that. Then I would just have to edit the requests with conditions on this table...
# Apr 22nd 2021, 15:12 v.plancher Just for the context... At first those tpd_ data were inside the users table. However now we can have multiple lines for a single user (Users hasMany ThirdPartyData), so I needed to put these data inside a new table. The "ThirdPartyData" is an hasOne association (Users hasOne TPD) that linked to the active line (other user's lines are archives).
# Apr 22nd 2021, 15:09 slackebot data, not inside a separate entity, like this (formated in array result, just to be more readable)... ```$order = [ 'user' => [ 'id', ..., 'tpd_uuid', 'tpd_readable_id', ... ] ];``` My tpd_ data is returned at the order level (root level of results, I don't know why), user level (first level of results, that's what I want) and inside a _matchingData containing the user entity. *What am I doing wrong?*
# Apr 22nd 2021, 15:09 slackebot $query->leftJoinWith('ThirdPartyData') ->select([ 'tpd_uuid' => 'ThirdPartyData.uuid', 'tpd_readable_id' => 'ThirdPartyData.readable_id', 'tpd_shared_key' => 'ThirdPartyData.shared_key', 'tpd_pairing_code' => 'ThirdPartyData.pairing_code', ]); }``` My aim is to return the "ThirdPartyData" directly with the User entity
# Apr 22nd 2021, 15:09 v.plancher Hello there. Why does a leftJoinWith produces a _matchingData in some requests? (Cake 3.x) Do the requests need something to avoid the matchingData? In my case... ```$this->Orders->find() ->contain('Users', function ($q) { return $q->find('third_party_data')->select(['id']); // Cake asks me to add Users.id })->first();``` ```public function findThirdPartyData(Query $query, array $options) { return
# Apr 22nd 2021, 14:42 davinci Have tried a few times to get the log to include the URI, but had no luck. It's been awhile, so I forget the particular issue, but I believe I even talked through with some people on here and we couldn't get it to work.
# Apr 22nd 2021, 14:41 davinci @steinkel the variable is defined in the controller and supposedly passed into the view, but that's the issue - it's saying it's an undefined variable in the view.
# Apr 22nd 2021, 14:38 marius.treu Thx
# Apr 22nd 2021, 14:33 steinkel @davinci check if variable is defined in the view, if now log the request uri ?
# Apr 22nd 2021, 14:30 davinci not easily
# Apr 22nd 2021, 14:29 greg138 Can you line up the error log entries with Apache logs?