Log message #4189626

# At Username Text
# Jun 15th 2019, 02:28 admad @stephenzgalbraith yes they have cake 4 compatible branches
# Jun 15th 2019, 01:34 stephenzgalbraith Does anyone know if the official cakephp authentication/authorization plugins are working on the 4.x releases ?
# Jun 14th 2019, 23:38 khalid @rightscoreanalysis yes or maybe you can paste code
# Jun 14th 2019, 23:37 khalid @dereuromark can you check my exceptionhandler issue.. any suggestion would be highly appreciated
# Jun 14th 2019, 23:03 rightscoreanalysis something like: use use App\Model\ListingTable ?
# Jun 14th 2019, 22:50 ricksaccous phew
# Jun 14th 2019, 22:50 ricksaccous hang
# Jun 14th 2019, 22:50 ricksaccous I'm starting to get tthe hand of widgets
# Jun 14th 2019, 22:34 dereuromark You just forgot your use statement. Use an IDE, it helps to do those things
# Jun 14th 2019, 21:14 khalid Or with tablelocator get object of model and call its getter method
# Jun 14th 2019, 21:13 khalid I guess you can try to load model in controller
# Jun 14th 2019, 21:13 rightscoreanalysis it's trying to find a controller
# Jun 14th 2019, 21:13 rightscoreanalysis the error I get is: 'App\Controller\Api\ListingTable' not found
# Jun 14th 2019, 21:09 rightscoreanalysis but how can I reference it in a controller?
# Jun 14th 2019, 21:09 rightscoreanalysis in another model table file I can reference the const with: ListingTable::TYPES['Sale'];
# Jun 14th 2019, 21:08 rightscoreanalysis In my model table file I have a constant: const TYPES = ['Sale' => '1', 'Wanted' => '2'];
# Jun 14th 2019, 18:01 fr3nch13 How I do it is I always keep server specific settings, and account settings like the api username/password/keys in the .env file, then use the env() function in the app.php. I use the .gitignore to keep the .env out of the git repo, and include the app.php in the repo. Example in app.php Configure::write([ ‘App’ => [ ‘Name’ => env(‘APP_NAME’, ‘default if not set’) ] ]);
# Jun 14th 2019, 17:56 khalid And this error handler is a class in src/error
# Jun 14th 2019, 17:56 khalid You mean from where I am throwing exception? That would be controller yes
# Jun 14th 2019, 17:37 ashish_onmobile @khalid where are you throwing your exception in controller or else where
# Jun 14th 2019, 17:04 khalid Any suggestions help would be appreciated
# Jun 14th 2019, 17:04 khalid I even tried core error handler someone exceptions dont go to their display function too it goes upto constructor but not after
# Jun 14th 2019, 14:55 khalid it doesn't go to these functions.
# Jun 14th 2019, 14:55 slackebot1 _displayException($exception) { die('DIEING'); echo 'Theres has been an exception!'; } ```
# Jun 14th 2019, 14:55 khalid @admad Thanks for your reply, but I also tried it, but it doesn't seem to work or I am missing something so what I did was following. In bootstrap added my CustomErrorHandler and called register method (like it said in documentation). and in my CustomErrorHandler I have following ```public function _displayError($error, $debug) { die('DIEING'); echo 'There has been an error!'; } public function
# Jun 14th 2019, 14:45 st.steinkuehler @scuadra Have you check the SQL-Log in Debug Kit? Most of the times this helps to check which SQL the ORM has generated for the database
# Jun 14th 2019, 14:43 admad @khalid exception renderer only handles rendering of error responses. For your use case you use use custom error handler and/or custom exception middleware
# Jun 14th 2019, 14:42 st.steinkuehler @scuadra This seems strange to me: `'count' => $this->find()->func()->count('*'),`
# Jun 14th 2019, 14:36 khalid According to my understand it should go to CustomExceptionRenderer, where as for Errors its working fine, it goes to CustomExceptionRenderer but not for Exceptions. what I want is to Perform some actions on each Exception (SPL,Cake or Custom) like saving in database, sending email or something like this
# Jun 14th 2019, 14:33 khalid H Guys I have generated a CustomExceptionRenderer, registered it in config/app.php, now when I am throwing an exception it is not going to Renderer but it goes to Core BaseErrorHandler and from there it set renderer and now sure what happen next.
# Jun 14th 2019, 14:25 yamcomnet Matching does not work properly. not consistent. Sometimes finds correctly when return $q->where(['Payments.id' => '123456']);
# Jun 14th 2019, 14:24 yamcomnet #Works Fine $p = $this->Entries->Payments->find() ->where(['type' => 'top-up']) ->limit(3) ->toArray() ; debug($p); #Does not Find Anything?? $test = $this->Entries->find('all',['contain' => ['Payments']]) ->limit(3); $testi = $test->matching('Payments', function($q){ return $q->where(['Payments.type' => 'top-up']); });
# Jun 14th 2019, 14:24 yamcomnet Very Strange Things happening. Cake 3.7.8.
# Jun 14th 2019, 14:20 slackebot1 'YEAR(NewsArticles.date)' => 'DESC' ]) ->toArray();
# Jun 14th 2019, 14:20 scuadra How can I select an year from date in Cake 3. I have news_articles table and I want to find the number of articles for each year. I am doing the following: $this->find('all') ->select([ 'count' => $this->find()->func()->count('*'), 'YEAR(NewsArticles.date)' ]) ->where([ 'NewsArticles.date <=' => date('Y-m-d') ]) ->group('YEAR(NewsArticles.date)') ->order([
# Jun 14th 2019, 11:13 awi hm. I dont see there any errors
# Jun 14th 2019, 11:02 neon1024 I tend to use `var_dump($entity->getErrors())` as I dont believe that DebutKit always displays them if they’re nested
# Jun 14th 2019, 11:02 neon1024 They’re in the Entities errors property with a key of the table I think
# Jun 14th 2019, 11:01 awi Does aqnyone know, where I do get model validation errors when I save associated data into BelongsToMany Table using through?
# Jun 14th 2019, 10:37 berarma Thanks. Now I see all the options.
# Jun 14th 2019, 10:23 steinkel @berarma there is a mailing list here https://nimb.ws/OjApmC see the bottom of the page at https://cakephp.org/