Logs for #cakephp

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

# At Username Text
# Today, 00:11 graziel kind of hard to tell without all code thou
# Today, 00:11 graziel no problem
# Today, 00:11 swimboy I’m going to have to stop working on this now and pick it up again later. Thanks for your help.
# Today, 00:09 graziel how you patch your entitry
# Today, 00:09 graziel different error or same?
# Today, 00:09 swimboy Still no go
# Today, 00:08 graziel maybe i have older code but it should work
# Today, 00:08 graziel Add a localized time, date or datetime format validation rule to a field.
# Today, 00:07 swimboy Shoud that be `$validator->localizedDate('date', 'date');`
# Today, 00:06 graziel $validator->localizedTime('date', 'date');
# Today, 00:06 graziel there is different validator for localized format
# Today, 00:06 swimboy Yes, I get a validation error
# Today, 00:05 graziel you get validation error?
# Today, 00:05 graziel but what do you mean accept format?
# Today, 00:05 swimboy Nope, that doesn’t work either. Still only accepts it in “2019-06-16” format
# Today, 00:04 graziel try ->setLocaleFormat('MM/dd/yyyy')
# Today, 00:03 swimboy It’s frustrating. I know I have it working in one app I built two years ago, but I can’t figure out what I did.
# Today, 00:02 graziel well you could write your own data type and set it manually in table
# Today, 00:02 swimboy I dug through my old code, and the last time I just threw up my hands and wrote a function to change the format manually after submitting my form. It was a PITA because I had to call it every time I used a date in a form.
# Today, 00:01 graziel something silly
# Today, 00:01 graziel hm i remember i had something simmilar issue but i cant remember what it was
# Yesterday, 23:59 swimboy Besides, no matter what I change, the only format that gets accepted is “2019-06-16”
# Yesterday, 23:57 swimboy It says it uses icu
# Yesterday, 23:54 graziel i cant remember which format it takes icu or iso :S
# Yesterday, 23:53 swimboy Still doesn’t work with ```Type::build('date') ->useImmutable() ->useLocaleParser() ->setLocaleFormat('M/dd/y');```
# Yesterday, 23:51 graziel try forcing your format with ->setLocaleFormat
# Yesterday, 23:51 swimboy I have it like this: ```Type::build('date') ->useImmutable() ->useLocaleParser();```
# Yesterday, 23:50 swimboy I also have `Type::build('date')->useLocaleParser();` in my bootstrap
# Yesterday, 23:50 graziel so you need Type::build('date') not datetime
# Yesterday, 23:49 swimboy date
# Yesterday, 23:49 graziel or time or date?
# Yesterday, 23:49 graziel and you have datetime type in database?
# Yesterday, 23:28 swimboy Still running into problems. I tried putting `Type::build('datetime')->useLocaleParser();` in my controller, and in the bootstrap.php (where the other Type::build settings are), but neither had any effect.
# Yesterday, 23:17 graziel : )
# Yesterday, 23:16 swimboy Thanks!
# Yesterday, 23:15 graziel https://book.cakephp.org/3.0/en/core-libraries/internationalization-and-localization.html#parsing-localized-datetime-data
# Yesterday, 23:12 slackebot1 “2019-06-16” in the field, it accepts the value.
# Yesterday, 23:12 swimboy I know I solved this once in an older version of CakePHP, but a) I don’t remember how I did it, and b) I think it’s handled differently now. My default locale is set to “en-US” in config/app.php and my dates are displaying as “6/16/2019" as I expect; but I’m using a plain text field instead of the default three menus for input forms, and trying to save a record in the same format gets rejected as being invalid. If I manually type
# Yesterday, 22:44 joey.mukherjee Weird... some how the hydration is messing up. I had to set enableHydration (false) on my query and use it that way.
# Yesterday, 22:25 joey.mukherjee I json_encode an array in my beforeSave routine in my table. I see it save correctly into my database as a string. However, when I load it, some of my strings are set to '' or empty. Not all of them though. Any ideas?
# Yesterday, 20:48 stephenzgalbraith Trying to get the authentication plugin to work with v4 and getting this error
# Yesterday, 20:48 slackebot1 <stephenzgalbraith>
# Yesterday, 17:20 admad also you should be using `'controller' => 'Plots'` not `'controller' => '/plots'`
# Yesterday, 17:19 admad @joey.mukherjee cause the router adding current plugin to URLs by default. Add `'plugin' => false` to the URL array to prevent that
# Yesterday, 16:19 joey.mukherjee Basic question: I am trying to use the CakeDC/Users plugin with v3.7. I have a menubar.ctp as my element being included in my Template/Layout/default.ctp I have a: <a href="<?php echo $this->Url->build (['controller' => '/plots', 'action' => 'index']); ?>">Plots</a> and a <a href="profile">Profile</a>. When I go to the profile page, my Plots link now has a users prepended to it. Why?
# Yesterday, 16:06 rogerpro Thank you very much, @ndm and @admad. Actually, my specific goal is to run tests for a plugin intended for an app that uses token auth. At some point, it seemed easier to me to test controller actions directly instead of making the auth work in test dev. Or, more important, test plugin functionality no matter which auth config is set up in the app.
# Yesterday, 15:41 admad https://github.com/ADmad/cakephp-i18n/blob/master/tests/bootstrap.php#L11-L24
# Yesterday, 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
# Yesterday, 15:39 slackebot1 directory (`../../vendor/bin/phpunit`).
# Yesterday, 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
# Yesterday, 15:09 rogerpro So everyone using running tests from a standalone plugin that has a bootstrap file should face the issue, I guess.
# Yesterday, 15:08 rogerpro Got it, it’s here but not loaded. Hope this is not happening only to me :)
# Yesterday, 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); ```
# Yesterday, 15:07 rogerpro It is actually here:
# Yesterday, 14:58 admad I don't remember from where/how it's supposed to be auto loaded
# Yesterday, 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
# Yesterday, 14:47 rogerpro 7.2.17-0ubuntu0.18.04.1
# Yesterday, 14:46 rogerpro I got the same error
# Yesterday, 14:46 admad What's your PHP version?
# Yesterday, 14:46 admad Try `composer update --with-dependencies`
# Yesterday, 14:45 rogerpro Sure
# Yesterday, 14:45 rogerpro Actually, I also ran `rm -rf vendor/ composer.lock andand composer clearcache andand composer install andand vendor/bin/phpunit`
# Yesterday, 14:45 admad Ah right, I misread, it would install latest 3.7 even with `^3.5`
# Yesterday, 14:44 rogerpro Of course
# Yesterday, 14:43 admad Did you run composer update after changing it?
# Yesterday, 14:41 rogerpro Nope. It actually installs 3.7.8. And updating it to `"^3.7"` keeps the PHPunit error.
# Yesterday, 14:38 admad Well you know what to do with that :slightly_smiling_face:
# Yesterday, 14:36 rogerpro “^3.5”
# Yesterday, 14:33 admad @rogerpro what's the cakephp version specific in composer.json?
# Yesterday, 14:30 rogerpro Got same error
# Yesterday, 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.
# Yesterday, 14:20 admad @rogerpro delete the vendor directory and composer.lock file, clear composer cache, then run composer install again
# Yesterday, 13:55 rogerpro I just reported a bug: https://github.com/cakephp/cakephp/issues/13353 — no idea why this is happening
# Yesterday, 08:39 graziel https://github.com/cakephp/cakephp/blob/master/tests/TestCase/ORM/TableTest.php
# Yesterday, 08:38 maymeow complete tests examples
# Yesterday, 08:37 graziel still not sure what you need, mock table? test finders?
# Yesterday, 08:32 maymeow for models im using tests li this https://gist.github.com/MayMeow/a163111262275ec1ff70e25dd29b08ab (dont remember where i found it)
# Yesterday, 08:29 maymeow For example how to test models Tables
# Yesterday, 08:07 graziel and also in book https://book.cakephp.org/3.0/en/development/testing.html
# Yesterday, 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
# Yesterday, 07:58 maymeow is there any good examples of CakePHP 3.x tests?
# Yesterday, 07:57 maymeow Hi
# Yesterday, 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.
# Jun 15th, 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.
# Jun 15th, 23:27 slackebot1 $('#gvmain_content').html (data); }, error: function (data) { alert ('Something went wrong!'); console.log (data); $('#gvmain_content').html (data); } }); });
# Jun 15th, 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) {
# Jun 15th, 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
# Jun 15th, 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); },
# Jun 15th, 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
# Jun 15th, 23:21 khalid can you show Ajax call here?
# Jun 15th, 23:11 joey.mukherjee @khalid Hmm, yes, I did have it in there. However, taking it out didn't fix it. Any other ideas?
# Jun 15th, 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.
# Jun 15th, 22:52 khalid if that is there then you can remove it from Routes.php
# Jun 15th, 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();
# Jun 15th, 22:48 khalid @joey.mukherjee do you have csrf in your routes.php?
# Jun 15th, 21:51 scriptstupid disregard! Got it working. (className wasn't set to Smtp)
# Jun 15th, 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"
# Jun 15th, 20:28 waspinator can you have virtual fields for _joinData?
# Jun 15th, 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?
# Jun 15th, 08:27 admad @rightscoreanalysis you need to "use" the listingtable class, not TableRegistry