Logs for #cakephp

Page 1 of 36,153, showing 100 records out of 3,615,276 total, starting on record 1, ending on 100

# At Username Text
# Today, 15:41 admad https://github.com/ADmad/cakephp-i18n/blob/master/tests/bootstrap.php#L11-L24
# Today, 15:39 ndm A bit old, but the concept is still the same: https://stackoverflow.com/questions/35565066/setting-up-cakephp-3-plugin-testing/35611216#35611216
# Today, 15:39 ndm @rogerpro If you plan to make a standalone plugin, then you need to clear the auto-generated `tests/bootstrap.php` file and use it to set up an application environment that pulls in the core's bootstrap. If you're making a plugin that's part of your app, then you need to use the phpunit installation of the app, and run it either from the app's root and pass the plugin path (`vendor/bin/phpunit plugins/ContactManager`), or run it from your plugin
# Today, 15:39 slackebot1 directory (`../../vendor/bin/phpunit`).
# Today, 15:09 rogerpro So everyone using running tests from a standalone plugin that has a bootstrap file should face the issue, I guess.
# Today, 15:08 rogerpro Got it, it’s here but not loaded. Hope this is not happening only to me :)
# Today, 15:07 rogerpro ``` total@aadd2f92f77f:~/mnt/my_app_name/plugins/ContactManager$ cat vendor/cakephp/cakephp/tests/phpunit_aliases.php <?php if (class_exists('PHPUnit_Runner_Version')) { if (version_compare(\PHPUnit_Runner_Version::id(), '5.7', '<')) { trigger_error(sprintf('Your PHPUnit Version must be at least 5.7.0 to use CakePHP Testsuite, found %s', \PHPUnit_Runner_Version::id()), E_USER_ERROR); ```
# Today, 15:07 rogerpro It is actually here:
# Today, 14:58 admad I don't remember from where/how it's supposed to be auto loaded
# Today, 14:58 admad For some reason this file isn't being loaded for you https://github.com/cakephp/cakephp/blob/master/tests/phpunit_aliases.php
# Today, 14:47 rogerpro 7.2.17-0ubuntu0.18.04.1
# Today, 14:46 rogerpro I got the same error
# Today, 14:46 admad What's your PHP version?
# Today, 14:46 admad Try `composer update --with-dependencies`
# Today, 14:45 rogerpro Sure
# Today, 14:45 rogerpro Actually, I also ran `rm -rf vendor/ composer.lock andand composer clearcache andand composer install andand vendor/bin/phpunit`
# Today, 14:45 admad Ah right, I misread, it would install latest 3.7 even with `^3.5`
# Today, 14:44 rogerpro Of course
# Today, 14:43 admad Did you run composer update after changing it?
# Today, 14:41 rogerpro Nope. It actually installs 3.7.8. And updating it to `"^3.7"` keeps the PHPunit error.
# Today, 14:38 admad Well you know what to do with that :slightly_smiling_face:
# Today, 14:36 rogerpro “^3.5”
# Today, 14:33 admad @rogerpro what's the cakephp version specific in composer.json?
# Today, 14:30 rogerpro Got same error
# Today, 14:29 rogerpro Did not worked for me, @admad . I did `rm -rf vendor/ composer.lock andand composer clearcache andand composer install andand vendor/bin/phpunit` in the plugin’s directory.
# Today, 14:20 admad @rogerpro delete the vendor directory and composer.lock file, clear composer cache, then run composer install again
# Today, 13:55 rogerpro I just reported a bug: https://github.com/cakephp/cakephp/issues/13353 — no idea why this is happening
# Today, 08:39 graziel https://github.com/cakephp/cakephp/blob/master/tests/TestCase/ORM/TableTest.php
# Today, 08:38 maymeow complete tests examples
# Today, 08:37 graziel still not sure what you need, mock table? test finders?
# Today, 08:32 maymeow for models im using tests li this https://gist.github.com/MayMeow/a163111262275ec1ff70e25dd29b08ab (dont remember where i found it)
# Today, 08:29 maymeow For example how to test models Tables
# Today, 08:07 graziel and also in book https://book.cakephp.org/3.0/en/development/testing.html
# Today, 08:06 graziel but what do you need exactly? theres a bunch of tests in cake already https://github.com/cakephp/cakephp/tree/master/tests
# Today, 07:58 maymeow is there any good examples of CakePHP 3.x tests?
# Today, 07:57 maymeow Hi
# Today, 04:20 subhanahmed Hi All, I just updated an old app to cakephp 3.7. I’m getting the following error: `Property _transportConfig does not exist ` in `ROOT/vendor/cakephp/debug_kit/src/Panel/MailPanel.php, line 43 ` Any solutions? Thanks.
# Yesterday, 23:29 joey.mukherjee @khalid These are my two ajax calls. I feel like they are pretty basic... I see the _Token in my page source. It is just after the form end.
# Yesterday, 23:27 slackebot1 $('#gvmain_content').html (data); }, error: function (data) { alert ('Something went wrong!'); console.log (data); $('#gvmain_content').html (data); } }); });
# Yesterday, 23:27 slackebot1 complete: function () { // alert ('Complete on submission!'); } }); e.preventDefault (); }); $('body').on ('change', "#gv_version", function () { var version = $('#gv_version').val (); var ajaxData = $('#gvInputForm').serializeArray (); $.ajax ({ url:"<?php echo
# Yesterday, 23:27 slackebot1 $this->Url->build ('/plots/change_version', true); ?>", type: 'GET', beforeSend: function (xhr) { xhr.setRequestHeader ('X-CSRF-Token', $('[name="_csrfToken"]').val ()); }, data: {version: version}, dataType: 'html', success: function (data) {
# Yesterday, 23:27 slackebot1 ('X-CSRF-Token', $('[name="_csrfToken"]').val ()); }, data: data, success: function (data, text, xhr) { $('#output_div').html (data); }, error: function () { alert ('Error on submission!'); $('#output_div').html (data); },
# Yesterday, 23:27 joey.mukherjee $('body').on ('submit', "#gvInputForm", function (e) { data = $('#gvInputForm').serializeArray (), formURL = $('#gvInputForm').attr ('action'); // + '.json'; $.ajax ({ url: formURL, dataType: 'html', type: 'POST', beforeSend: function (xhr) { xhr.setRequestHeader
# Yesterday, 23:21 khalid can you show Ajax call here?
# Yesterday, 23:11 joey.mukherjee @khalid Hmm, yes, I did have it in there. However, taking it out didn't fix it. Any other ideas?
# Yesterday, 23:07 scriptstupid I'm using FormHelper::control for a form and validation errors aren't being displayed. The entity is not saving and in the controller I can set a var to $entity->getErrors() and see them, yet the form itself displays nothing. Fields are named appropriately.
# Yesterday, 22:52 khalid if that is there then you can remove it from Routes.php
# Yesterday, 22:51 khalid if yes then you have to remove it.. because you can use it either routes based of on overall application, before you do it please check your Application.php it should have something like this $csrf = new CsrfProtectionMiddleware();
# Yesterday, 22:48 khalid @joey.mukherjee do you have csrf in your routes.php?
# Yesterday, 21:51 scriptstupid disregard! Got it working. (className wasn't set to Smtp)
# Yesterday, 21:43 kiwi_10 Hello. I've configured my default EmailTransport with the SSL info for my domain (port 465, etc.). I can see the correct templated email in the mail tab of DebugKit. Nonetheless, I get a SocketException with error "Failed to connect to mailserver at "localhost" port 25"
# Yesterday, 20:28 waspinator can you have virtual fields for _joinData?
# Yesterday, 19:35 joey.mukherjee when I do a form submit with csrf middleware I can get it to work the first time, but after an ajax request which changes the contents of the form, I get a _Token not found error. anyone have any ideas?
# Yesterday, 08:27 admad @rightscoreanalysis you need to "use" the listingtable class, not TableRegistry
# Yesterday, 07:37 rightscoreanalysis I think I need this: use Cake\ORM\TableRegistry;
# Yesterday, 07:35 rightscoreanalysis In my model table file I have a constant: const TYPES = ['Sale' => '1', 'Wanted' => '2']; in another model table file I can reference the const with: ListingTable::TYPES['Sale']; but how can I reference it in a controller? the error I get is: 'App\Controller\Api\ListingTable' not found it's trying to find a controller
# Yesterday, 07:35 rightscoreanalysis still strugglng with this
# Yesterday, 05:15 admad As for how the middleware handles various exceptions walk through the errormiddleware code it
# Yesterday, 05:14 admad @khalid don't understand what $next does read up about PSR-7 double pass middlewares. It's a general standard from the PHP-FIG group
# Yesterday, 03:34 khalid what I want is one place where I have Exception object which I can use to do post exception tasks.
# Yesterday, 03:33 khalid but CoreException seems to by pass all that..
# Yesterday, 03:33 khalid SPL Exceptions more or less follow the same structure of Errors
# Yesterday, 03:33 khalid my question is: where and how it decide it how it needs to treat Core Exception differently than errors or spl exceptions
# Yesterday, 03:32 khalid in error middleware what does this do? return $next($request, $response); I checked next its an object and its as far as I can notice its same for both error and exception but in case of Error it goes to Throwable, but in case of Exception it goes to Core Exception class constructor
# Yesterday, 03:05 joey.mukherjee In case someone else has the same problem with the "Fatal error: Class 'App\Shell\Task\QueueTask' not found" error - the documentation is wrong. The Task needs to go into /src/Shell/Task/Queue and not /src/Shell/Task/ as the documentation says
# Yesterday, 02:50 khalid @admad does cake have this in their documentation? Thanks for help mate
# Yesterday, 02:30 joey I am getting this error when trying to use the queue plugin. I think I am missing a use line, but I have it! Any ideas? This is the error: Fatal error: Class 'App\Shell\Task\QueueTask' not found
# Yesterday, 02:30 admad @khalid you need a custom exception middleware and load that instead of the core one in your Application:: bootstrap ()
# Yesterday, 02:28 admad @stephenzgalbraith yes they have cake 4 compatible branches
# Yesterday, 01:34 stephenzgalbraith Does anyone know if the official cakephp authentication/authorization plugins are working on the 4.x releases ?
# Jun 14th, 23:38 khalid @rightscoreanalysis yes or maybe you can paste code
# Jun 14th, 23:37 khalid @dereuromark can you check my exceptionhandler issue.. any suggestion would be highly appreciated
# Jun 14th, 23:03 rightscoreanalysis something like: use use App\Model\ListingTable ?
# Jun 14th, 22:50 ricksaccous phew
# Jun 14th, 22:50 ricksaccous hang
# Jun 14th, 22:50 ricksaccous I'm starting to get tthe hand of widgets
# Jun 14th, 22:34 dereuromark You just forgot your use statement. Use an IDE, it helps to do those things
# Jun 14th, 21:14 khalid Or with tablelocator get object of model and call its getter method
# Jun 14th, 21:13 khalid I guess you can try to load model in controller
# Jun 14th, 21:13 rightscoreanalysis it's trying to find a controller
# Jun 14th, 21:13 rightscoreanalysis the error I get is: 'App\Controller\Api\ListingTable' not found
# Jun 14th, 21:09 rightscoreanalysis but how can I reference it in a controller?
# Jun 14th, 21:09 rightscoreanalysis in another model table file I can reference the const with: ListingTable::TYPES['Sale'];
# Jun 14th, 21:08 rightscoreanalysis In my model table file I have a constant: const TYPES = ['Sale' => '1', 'Wanted' => '2'];
# Jun 14th, 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, 17:56 khalid And this error handler is a class in src/error
# Jun 14th, 17:56 khalid You mean from where I am throwing exception? That would be controller yes
# Jun 14th, 17:37 ashish_onmobile @khalid where are you throwing your exception in controller or else where
# Jun 14th, 17:04 khalid Any suggestions help would be appreciated
# Jun 14th, 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, 14:55 khalid it doesn't go to these functions.
# Jun 14th, 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, 14:55 slackebot1 _displayException($exception) { die('DIEING'); echo 'Theres has been an exception!'; } ```
# Jun 14th, 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, 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, 14:42 st.steinkuehler @scuadra This seems strange to me: `'count' => $this->find()->func()->count('*'),`
# Jun 14th, 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, 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, 14:25 yamcomnet Matching does not work properly. not consistent. Sometimes finds correctly when return $q->where(['Payments.id' => '123456']);
# Jun 14th, 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']); });