Logs for #cakephp

Page 1 of 35,970, showing 100 records out of 3,596,930 total, starting on record 1, ending on 100

# At Username Text
# Oct 10th, 01:57 blancessanchez30 how to do beforefilter before ajax call in cakephp 3
# Oct 10th, 01:57 blancessanchez30 good morning
# Oct 9th, 22:17 sdevore I use ‘hidden’ ;)
# Oct 9th, 22:13 rightscoreanalysis great thanks, I think it works now
# Oct 9th, 22:11 bmudda @rightscoreanalysis Yes according to the docs, that's correct.
# Oct 9th, 22:00 rightscoreanalysis in order to update
# Oct 9th, 22:00 rightscoreanalysis @bmudda so if Tags is my hasMany data do I need: echo $this->Form->control('tags.0.id');
# Oct 9th, 21:58 bmudda https://book.cakephp.org/3.0/en/views/helpers/form.html#creating-inputs-for-associated-data
# Oct 9th, 21:58 rightscoreanalysis is Foo hasMany Bar, do I need to set Bar.id in the request data to update it?
# Oct 9th, 21:54 rightscoreanalysis is anyone here?
# Oct 9th, 21:51 rightscoreanalysis which is this happening? This is an update to an existing record
# Oct 9th, 21:50 rightscoreanalysis if I debug the patch entity i see: '[new]' => true,
# Oct 9th, 21:40 rightscoreanalysis no matter what it always tries to save new records which is wrong
# Oct 9th, 21:40 rightscoreanalysis https://gist.github.com/spacebiscuit/59a4ebbade0ea1e96f8b0a5faaf61735
# Oct 9th, 21:40 rightscoreanalysis this is totally screwed up and I don't see anything wrong with this request data
# Oct 9th, 21:32 rightscoreanalysis https://book.cakephp.org/3.0/en/orm/saving-data.html#saving-hasmany-associations
# Oct 9th, 21:32 rightscoreanalysis the book's example is not in this format....
# Oct 9th, 21:31 rightscoreanalysis I thought that hasMany data should be model.0.field
# Oct 9th, 21:22 rightscoreanalysis Is that enough?
# Oct 9th, 21:21 rightscoreanalysis $this->Form->input('id', ['type' => 'hidden', 'value' => $periodId]);
# Oct 9th, 21:21 rightscoreanalysis I am setting the id of the PropertyPeriod
# Oct 9th, 21:20 rightscoreanalysis in my case I am saving to PropertyPeriod whuch hasMany PropertyPrices
# Oct 9th, 21:19 bmudda @rightscoreanalysis ^
# Oct 9th, 21:18 bmudda you wouldn’t have to worry about fk in that case
# Oct 9th, 21:18 bmudda if you’re always passing all the records (associated data) during update, you can use the `replace` strategy
# Oct 9th, 21:18 bmudda yes, if you don’t pass the fk, then it will insert it as a new record
# Oct 9th, 21:17 rightscoreanalysis @bmudda I think the issue might be that I am not passing the fk
# Oct 9th, 21:14 bmudda https://book.cakephp.org/3.0/en/orm/saving-data.html#saving-hasmany-associations
# Oct 9th, 21:14 bmudda @rightscoreanalysis The default save strategy for hasMany is `append`. So unless you provide the foreign key as part of the record (for the associated data), it will insert it as a new record.
# Oct 9th, 21:06 rightscoreanalysis When saving hasMany relations how can I ensure that I update existing records, in my case my save its creating duplicate records
# Oct 9th, 20:54 rightscoreanalysis i figure dit!
# Oct 9th, 20:49 rightscoreanalysis I have a hasMany relation, when I save the parent the hasMany data is not saving
# Oct 9th, 19:47 rightscoreanalysis that works but I should be able to achieve the same goal without the foreach
# Oct 9th, 19:47 rightscoreanalysis foreach($x as and$y) { $y = Hash::combine($y, '{n}.room_id', '{n}'); }
# Oct 9th, 19:47 rightscoreanalysis can anyone help me refine something
# Oct 9th, 19:35 zomb thanks@steini
# Oct 9th, 19:18 st.steinkuehler @zomb in my table class in method `validationDefault` I use something like this for regex validation: $validator->regex('code','/[0-9a-z]{6}/',__('Der URL-Code darf nur Kleinbuchstaben und Zahlen enthalten.')); see also https://api.cakephp.org/3.6/class-Cake.Validation.Validator.html#_regex
# Oct 9th, 18:11 kitcat711_ I use the .htaccess for some 301 redirection occasionnaly (a part of my app is a forum and I change some slugs from time to time for GG)
# Oct 9th, 18:10 kitcat711_ thanks
# Oct 9th, 16:25 admad and the url rewriting rules should go directly into your apache config if you have access to ti
# Oct 9th, 16:24 admad setting server's document root to `webroot` is what everyone SHOULD do
# Oct 9th, 15:38 josbeir it should not be in there.
# Oct 9th, 15:07 kitcat711_ hey there, Using cake 3 with git, do we have any good reason to put webroot/.htaccess inside the gitignore?
# Oct 9th, 13:43 josbeir probably safest
# Oct 9th, 13:42 neon1024 Think I’m going to ajax for it on an ad-hoc basis, as the info is behind a user interaction
# Oct 9th, 13:39 josbeir i wouldn't mind if the logic behind it portable tho
# Oct 9th, 13:38 josbeir its idd quickest to go for a mutator
# Oct 9th, 13:37 josbeir @neon1024 interesting question
# Oct 9th, 13:18 ondrej.nedvidek Ok, good idea with the middle layer .. I will try, thank you.
# Oct 9th, 13:18 neon1024 Doesn’t feel right with me having an entity connect to a web service
# Oct 9th, 13:18 neon1024 Could I use a mutator?
# Oct 9th, 13:17 neon1024 Anyone have a neat way of loading additional data into an entity via a web service call?
# Oct 9th, 13:14 neon1024 https://github.com/cakephp/cakephp/blob/master/src/Error/Middleware/ErrorHandlerMiddleware.php#L106-L131
# Oct 9th, 13:12 neon1024 I’d use a custom ErrorHandlerMiddleware and catch the MissingRouteException
# Oct 9th, 12:35 ondrej.nedvidek Hi there. I have problem when redirecting to subdomain for certain /page/* and want to pass also all after /page/* to new subdomain. I can not use nginx/apache solution as I want to pass this to 'subdomain' only if no of 'routes' above this redirect will catch the request. As there is possibility that in future some pages will be server on main domain. I would prefer to avoid pure PHP solution, but at the moment I can not see other
# Oct 9th, 12:35 slackebot solution for this. Let me know if problem is clear ? Any idea ? Thank you
# Oct 9th, 11:29 neon1024 Interesting that it’s possible to break DebugKit by setting a header of `'X-Frame-Options: deny'`
# Oct 9th, 10:25 neon1024 What protocol are you currently using?
# Oct 9th, 10:22 johnwayne @neon1024 But how to update
# Oct 9th, 10:11 neon1024 https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/426
# Oct 9th, 09:59 johnwayne node.js is updated, npm, yarn, composer, php...
# Oct 9th, 09:58 johnwayne My local API (Swagger) works normally, but if I call that endpoint in cakephp then I am getting this error
# Oct 9th, 09:58 johnwayne can anybody help me with this problem ``` object(Cake\Http\Client\Response) { [protected] code => (int) 426 [protected] reasonPhrase => 'Upgrade Required' [protected] _xml => null [protected] _json => null [protected] _exposedProperties => [ 'cookies' => '_cookies', 'body' => '_getBody', 'code' => 'code', 'json' => '_getJson', 'xml' => '_getXml', 'headers' => '_getHeaders' ] [protected] _cookies => [] [protected] headers
# Oct 9th, 09:58 slackebot => [ 'Server' => [ (int) 0 => 'WebSocket++/0.5.1' ] ] [protected] headerNames => [ 'server' => 'Server' ] [private] protocol => '1.1' [private] stream => object(Zend\Diactoros\Stream) { [protected] resource => resource [protected] stream => 'php://memory' } } ```
# Oct 9th, 09:57 rudy1976s because actually it does not retrieve nothing
# Oct 9th, 09:56 rudy1976s is it correct to use this on a query contain ? I am using the following to find translation on associated : 'Seo' => function($q) { return $q->find('translations'); },
# Oct 9th, 09:56 rudy1976s I am working to try to retrieve translations on associations with contains
# Oct 9th, 09:55 rudy1976s good morning to all !!!!
# Oct 9th, 09:46 rrd564 @neon1024 uksort saved my day. Thanks :slightly_smiling_face:
# Oct 9th, 09:39 neon1024 I mean, if you’d put that into Google instead of Slack, you’d be there by now!
# Oct 9th, 09:39 neon1024 http://php.net/manual/en/language.exceptions.php
# Oct 9th, 09:38 neon1024 Use `try`
# Oct 9th, 09:29 blancessanchez30 how to catch an exception?
# Oct 9th, 09:24 rrd564 thanks
# Oct 9th, 09:24 rrd564 hm, even better
# Oct 9th, 09:23 neon1024 Then I could preserve the content and deal with the sorting just by index
# Oct 9th, 09:23 rrd564 Thanks for the hint, let's see where I iwll ended up :slightly_smiling_face:
# Oct 9th, 09:23 neon1024 I would probably use `usort()` and write my own function
# Oct 9th, 09:23 rrd564 I know, but it is not a problm for me at that point
# Oct 9th, 09:22 neon1024 If you are using an array of entities though they will not become entities again
# Oct 9th, 09:21 rrd564 but actually converting into an array, use ksort and converting back to a collection is an option
# Oct 9th, 09:20 neon1024 Ahok
# Oct 9th, 09:20 rrd564 ksort gives me: ksort() expects parameter 1 to be array, object given
# Oct 9th, 09:20 neon1024 Although, I’m not entirely sure on that you’d have to try it :slightly_smiling_face:
# Oct 9th, 09:20 neon1024 I believe, as it implements an iterator
# Oct 9th, 09:19 neon1024 https://github.com/cakephp/cakephp/blob/master/src/Collection/Collection.php#L27
# Oct 9th, 09:19 neon1024 No
# Oct 9th, 09:18 rrd564 But than I have to convert my collection to an array, right?
# Oct 9th, 09:18 neon1024 Collection implements ArrayInterface iirc
# Oct 9th, 09:18 neon1024 Use ksort or usort then
# Oct 9th, 09:18 rrd564 And I want to keep the indexes, just reordering them
# Oct 9th, 09:17 rrd564 @neon1024 That is not good for me, as I have several items in every group
# Oct 9th, 09:15 neon1024 `Collection::indexBy()`
# Oct 9th, 09:06 rrd564 Is there a way to sort a collection by the index of its items? Something like ksort for arrays? The collection is after a groupBy and I want to sort after the grouping
# Oct 9th, 09:01 martin update of my problem yesterday, it was just a fileserver that was not responding 100% :P
# Oct 9th, 09:01 martin Morning :)
# Oct 9th, 08:56 neon1024 Morning all :wave:
# Oct 9th, 08:52 dereuromark remove the specific file
# Oct 9th, 08:49 blancessanchez30 aside from $this->redirect('/'), what are the other redirection
# Oct 9th, 08:44 lubos @dereuromark what is the best way to clear just TinyAuth cache?