Logs for #cakephp

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

# At Username Text
# Oct 8th, 18:21 nk-sonu hi. what to do if i want to search multiple dates compare in OR in mysql with same 1 field ?
# Oct 8th, 18:14 developer Hi Guys. Hope all doing well. I was stuck in cakephp or condition. I want to use multiple OR condition with 3 different dates from same field.
# Oct 8th, 16:46 ricksaccous actually i figured out the replace strat thing
# Oct 8th, 16:42 rrd564 and I want to sort after the grouping
# Oct 8th, 16:42 rrd564 The collection is after a groupBy
# Oct 8th, 16:41 rrd564 Is there a way to sort a collection by the index of its items? Something lige ksort for arrays?
# Oct 8th, 15:07 ricksaccous some of them require looking at matching data on other models
# Oct 8th, 15:07 ricksaccous because i only want deletions in the replace based on certain conditions
# Oct 8th, 15:07 ricksaccous because while i do want some replace-like behavior sometimes on this project there always seems to be some quirk to it
# Oct 8th, 15:06 ricksaccous I'd love for a more robust replace strategy
# Oct 8th, 14:56 ricksaccous in saveStrategy replace, would it be possible to set replace conditions or something?
# Oct 8th, 14:54 ricksaccous ok
# Oct 8th, 14:54 martin no, only in before :(
# Oct 8th, 14:53 ricksaccous but not in aftersave huh
# Oct 8th, 14:53 martin and the fields are dirty that are changed
# Oct 8th, 14:53 martin In the beforesave you have the orignal data
# Oct 8th, 14:52 ricksaccous actually i want to compare old data with new data
# Oct 8th, 14:52 ricksaccous is it possible to compare request data with data actually saved?
# Oct 8th, 14:51 ricksaccous in cakephp3 aftersave
# Oct 8th, 14:45 martin I know, walking tru the code now slowly checking where it stops :S
# Oct 8th, 14:44 ricksaccous good luck
# Oct 8th, 14:44 ricksaccous that's horrible
# Oct 8th, 14:44 ricksaccous oh
# Oct 8th, 14:44 martin did work till a few hours ago, thats why I don’t understand it :S
# Oct 8th, 14:44 martin yes
# Oct 8th, 14:42 ricksaccous have you read the server configuration set up instructions for cakephp3?
# Oct 8th, 14:42 ricksaccous apache or nginx?
# Oct 8th, 14:42 ricksaccous what are you using
# Oct 8th, 14:41 martin nothing in logs already tried to enable debug and logging to be sure, but nothing, keeps loading
# Oct 8th, 14:40 ricksaccous @martin have you checked the server logs, apache, and/or nginx?
# Oct 8th, 14:17 martin and I don’t see any errors, only that my php-fpm is full with handling the requests
# Oct 8th, 14:16 martin other project works fine. but this projects fail, even the old releases what did run before without any problems
# Oct 8th, 14:16 martin and I’m clueless now what can be the reason,
# Oct 8th, 14:15 martin I’ve on production server that it does not handle requests anymore with cakephp 3.6. when I call a script in webroot directory it works fine, but index.php no response
# Oct 8th, 13:57 ricksaccous no problem ;)
# Oct 8th, 13:57 rrd564 @ricksaccous thanks. That was it. Now my problem solved. :slightly_smiling_face:
# Oct 8th, 13:47 ricksaccous @rrd it's kind of weird how it works
# Oct 8th, 13:47 rrd564 ok I iwll try it
# Oct 8th, 13:47 ricksaccous so you prob need two different query objects of the same query, maybe
# Oct 8th, 13:46 ricksaccous if that makes sense
# Oct 8th, 13:46 ricksaccous it's going to pass the query by reference
# Oct 8th, 13:46 ricksaccous and do a collection on it
# Oct 8th, 13:46 ricksaccous basically any time you call the base query object
# Oct 8th, 13:46 ricksaccous hmmm
# Oct 8th, 13:46 ricksaccous passed the other way, lol
# Oct 8th, 13:45 ricksaccous so i think queries are passed by reference, but once you get out of the query it would then have to be uhhhh
# Oct 8th, 13:43 rrd564 @ricksaccous https://pastebin.com/GCw8Dbd9
# Oct 8th, 13:37 ricksaccous @rrd it's hard to understand your implementation and why what's happening is happening without seeing some code
# Oct 8th, 13:36 rrd564 I need an entity in 2 different collection, but I want to change one property in one collection. As they contains the same entity it changes in the other one. How to prevent this?
# Oct 8th, 13:36 madbbb @ricksaccous thank you, both of your suggestions work. I forgot to put 'CombinedOrders.name' in select() as well.Now everything works as expected.
# Oct 8th, 13:21 ricksaccous well, same principle
# Oct 8th, 13:20 madbbb sorry, it's not CombinedRecords its CombinedOrders
# Oct 8th, 13:20 ricksaccous it would be 'Trackings' => ['queryBuilder' => function(){}, 'CombinedRecords'
# Oct 8th, 13:19 ricksaccous so instead of 'Trackings' => function
# Oct 8th, 13:19 ricksaccous i believe but that query function in a queryBuilder key of the array in combined
# Oct 8th, 13:19 ricksaccous or you could
# Oct 8th, 13:19 ricksaccous $q->contain(['CombinedRecords'])
# Oct 8th, 13:18 ricksaccous you can put it directly in the query
# Oct 8th, 13:17 madbbb Hello. I have a contain condition in my query, but I don't understand how to get associated record here. I need to get Trackings.CombinedRecords association. Where should I put contain(['CombinedRecords ']). Tried to insert it everywhere with no luck
# Oct 8th, 12:33 spencdev For most, yeah.
# Oct 8th, 12:33 dereuromark even though I find this pretty obvious :P
# Oct 8th, 12:32 dereuromark @spencdev good call yeah. thats why I use the pipe.
# Oct 8th, 12:31 CakeEater So I can't install cakephps TestSuite as a standalone ?
# Oct 8th, 12:30 CakeEater As far as I can see there is no stand alone version of cakePHPs test part
# Oct 8th, 12:29 CakeEater I use the standalone orm from cakephp for a websocket server (ratchet) and im using phpUnit for my tests, I would like to use the fixtures cakePHP generates.
# Oct 8th, 12:26 lubos it seems that `patchEntity` is doing `query->firstOrFail` before patching, is that possible?
# Oct 8th, 12:04 spencdev It should probably just be noted that whatever is being used as a delimiter couldn't be used as a search parameter
# Oct 8th, 12:04 spencdev I'd agree, pretty rare. I think most people would use it as `,` though, which could cause some issues
# Oct 8th, 12:00 dereuromark we could always add escaping options into it too, not sure if worth it, though
# Oct 8th, 11:59 dereuromark I think | is rather similarly rare in actual use
# Oct 8th, 11:59 dereuromark same thing with the wildcards :slightly_smiling_face:
# Oct 8th, 11:59 dereuromark thats the point. yo need to configure it manually per use case.
# Oct 8th, 11:51 spencdev what if you're literally looking for something with | in it?
# Oct 8th, 11:42 dereuromark @admad etc: Can I have quick feedback on https://github.com/FriendsOfCake/search/pull/240 ? So I could write a few tests?
# Oct 8th, 11:17 neon1024 perhaps cast to array and use `array_column()`
# Oct 8th, 11:17 rrd564 @neon1024 thanks
# Oct 8th, 11:17 neon1024 Or convert to array and use `array_unique`
# Oct 8th, 11:16 neon1024 https://book.cakephp.org/3.0/en/core-libraries/collections.html#Cake\Collection\Collection::groupBy
# Oct 8th, 11:16 neon1024 Probably `groupBy` would be my first guess
# Oct 8th, 10:52 rrd564 what is the best way to get uniqe elements from a collection? For example in a blog I want to get all the tags used by the listed posts.
# Oct 8th, 10:26 neon1024 The guys over in the PHP UG channel suggesting using ZAP Proxy, and it’s done great at identifying a bunch of things I can fix to help secure my project.
# Oct 8th, 10:25 neon1024 Thanks!
# Oct 8th, 10:25 josbeir sorry for the late reply :slightly_smiling_face:
# Oct 8th, 10:24 josbeir @neon1024 yes escaped, unless you use updateAll and deleteAll etc
# Oct 8th, 09:51 rudy1976s I normally avoid using json fields when I need to translate info
# Oct 8th, 09:51 rudy1976s that was I though too
# Oct 8th, 09:50 edgaras.jan possible but pretty hard
# Oct 8th, 09:50 rudy1976s is possible ?
# Oct 8th, 09:49 rudy1976s last question: what can be the best way to use Translate Behavior in such field ?
# Oct 8th, 09:48 edgaras.jan `JSON_EXTRACT(json_field, '$.color')`
# Oct 8th, 09:48 rudy1976s thank you !
# Oct 8th, 09:47 edgaras.jan Read here first https://dev.mysql.com/doc/refman/5.7/en/json.html
# Oct 8th, 09:44 rudy1976s for example in the json field I have a field called color : is possibile to use the ->where using the color json field?
# Oct 8th, 09:42 rudy1976s but the query builder “knows” the fileds contained in the json ?
# Oct 8th, 09:41 neon1024 The MySQL documentation shows you all the various sql you can use
# Oct 8th, 09:41 neon1024 Sure you can
# Oct 8th, 09:41 rudy1976s the column is used to store record parameters and sometimes I need to query against a value contained in that field
# Oct 8th, 09:40 rudy1976s can I use the json fields in the query builder ?
# Oct 8th, 09:39 rudy1976s I using a table with a columns used as json type
# Oct 8th, 09:39 rudy1976s good morning