Log message #4261671

# At Username Text
# 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?
# Apr 22nd 2021, 14:10 davinci would LOVE if it did, but - no luck in cake 2 that I'm aware of
# Apr 22nd 2021, 14:04 davinci it does not show the URL :S
# Apr 22nd 2021, 14:02 kevin.pfeifer well, I am on Cake 4 and not cake 2 but i guess it should still have that in there
# Apr 22nd 2021, 14:02 slackebot 105```
# Apr 22nd 2021, 14:02 kevin.pfeifer ```2021-04-15 20:14:49 Notice: Notice (8): Trying to get property 'name' of non-object in [<my-path>/templates/Projects/overview.php, line 43] Request URL: /projects/overview Referer URL: http://alfred.sunlime.cc:8000/projects/edit/395 Trace: Cake\Error\BaseErrorHandler::handleError() - CORE/src/Error/BaseErrorHandler.php, line 188 DebugKit\Plugin::DebugKit\{closure}() - ROOT/vendor/cakephp/debug_kit/src/Plugin.php, line
# Apr 22nd 2021, 14:01 kevin.pfeifer The log should tell you which Request and Referer the user used to get to that error I guess you already checked that
# Apr 22nd 2021, 13:44 davinci happens many times a day, so it's not just a fluke, but...
# Apr 22nd 2021, 13:43 davinci I see it happening a decent amount in the logs, but have no idea how to reproduce or what to even try to get it to reproduce
# Apr 22nd 2021, 13:43 davinci @kevin.pfeifer cannot reproduce :(
# Apr 22nd 2021, 13:43 kevin.pfeifer if you can reproduce it i would set an `xdebug_break()` in the template and look at the available variables and the call stack
# Apr 22nd 2021, 13:40 davinci This isn't the exact method, but it's pretty darn close to this simple: ```public function confirm($id = null) { $order = $this->Order->getDetails($id); $this->set(compact('order')); }``` and yet somehow, in logs, I'm seeing that the view is throwing `Undefined variable: order in...` the view file, right at the top of the View.
# Apr 22nd 2021, 13:37 davinci Getting "undefined variable `order` ..." in a view where it seems clear it should always have the variable defined. Are there edge-cases that allow a view to load without setting the variables from the controller? (cakephp 2.x)
# Apr 22nd 2021, 12:39 marius.treu thanks for the help!
# Apr 22nd 2021, 12:39 marius.treu i saw it but didnt quite understand it to be honest lol
# Apr 22nd 2021, 11:25 admad Also if you use authorization plugin it already provides the feature to redirect to required URL on authorization failure https://book.cakephp.org/authorization/2/en/middleware.html#handling-unauthorized-requests
# Apr 22nd 2021, 11:17 admad @marius.treu congrats on your hack. The proper way to achieve the same would be to use a custom exception renderer https://book.cakephp.org/4/en/development/errors.html#custom-exceptionrenderer
# Apr 22nd 2021, 08:42 slackebot ApplicationExceptionHandler::handleException($e);         }     }
# Apr 22nd 2021, 08:42 marius.treu public function invokeAction(Closure $action, array $args): void     {         try {             parent::invokeAction($action, $args);         } catch (UnauthorizedResourceRequest $unauthorizedResourceRequest) {             $response = $this->redirectToLandingPage();         } catch (Throwable $e) {             $response =
# Apr 22nd 2021, 08:41 marius.treu @admad i found the solution, you just have to overwrite the invokeAction function in the controller
# Apr 22nd 2021, 06:43 nayakvradhit Ok sure thanks
# Apr 22nd 2021, 06:43 nayakvradhit Yeah info.php was working strange
# Apr 22nd 2021, 06:13 asyraf.wahianuar great! thanks, @kevin.pfeifer
# Apr 22nd 2021, 06:11 kevin.pfeifer as stated here https://book.cakephp.org/4/en/development/sessions.html#accessing-the-session-object