Logs for #cakephp

Page 4 of 36,163, showing 100 records out of 3,616,256 total, starting on record 301, ending on 400

# At Username Text
# Jun 20th, 15:50 neon1024 `$this->Users->behaviors()->unload('Trash')`
# Jun 20th, 15:41 peppejaripappalardo Guys someone who use Muffin/Trash: I have implemented the soft-delete for the Users Table. But these users are related to Missions and Events. When i soft-delete a User, the query of Events or Missions stop to render the Event or the Mission related to the UserID who is soft-deleted. I tryed to deactivate the Behavior with $this->Users->removeBehavior('Trash') into the EventsController, but it dosen't work. Any suggestions?
# Jun 20th, 15:32 rudy1976s @jeremyharris thank you , I will try the @dereuromark plugin
# Jun 20th, 15:30 jeremyharris yep, you can write your own log engine or use an existing plugin: https://github.com/FriendsOfCake/awesome-cakephp#auditing--logging
# Jun 20th, 15:29 rudy1976s I have a question regarding logs: is there a way to be able to save log to DB using the cake Log class ?
# Jun 20th, 15:28 rudy1976s good afternoon to all bakers!
# Jun 20th, 14:24 neon1024 Thanks!
# Jun 20th, 14:17 jeremyharris includes polyfills only where necessary
# Jun 20th, 14:17 jeremyharris I saw this come across HN, might be of interest: https://www.pika.dev/cdn
# Jun 20th, 14:16 neon1024 I’ve been meaning to look for an NPM module which adds polyfills for stuff so that it just gets baked in when I build with Webpack, but I didn’t get there yet
# Jun 20th, 14:15 neon1024 I didn’t try it though
# Jun 20th, 14:15 neon1024 https://www.theverge.com/2019/4/8/18300077/microsoft-edge-chromium-canary-development-release-download
# Jun 20th, 14:14 neon1024 9, 10, 11, Edge, and then onto this new Chromium based browser apparently
# Jun 20th, 14:14 jeremyharris gotcha
# Jun 20th, 14:14 neon1024 After 11 I believe
# Jun 20th, 14:14 jeremyharris yeah not in IE but it’s in edge, which was like IE 10 or 11 right? I’ve been away from frontend for a while
# Jun 20th, 14:13 neon1024 Tbh caniuse is probably more accurate
# Jun 20th, 14:13 neon1024 Perhaps the page is out of date https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise#Browser_compatibility
# Jun 20th, 14:13 neon1024 Hmm
# Jun 20th, 14:13 jeremyharris for better or for worse
# Jun 20th, 14:13 jeremyharris but yeah it’s all going to be 2 engines in not too long
# Jun 20th, 14:13 neon1024 I guess that’s why they are stealing the Chrome JS engine :)
# Jun 20th, 14:13 jeremyharris caniuse shows promises are in there
# Jun 20th, 14:13 neon1024 They’re now so far behind the JS curve it’s not even worth considering them
# Jun 20th, 14:12 neon1024 Even basic stuff like fetch and promises aren’t in
# Jun 20th, 14:12 neon1024 They gave up in like IE7
# Jun 20th, 14:12 neon1024 Well yeah Microsoft just can’t work Javascript it seems
# Jun 20th, 14:12 neon1024 Be sure to note the browser compatibility!
# Jun 20th, 14:12 jeremyharris no support in edge at all sadly
# Jun 20th, 14:11 jeremyharris that’s cool :nerd_face:
# Jun 20th, 14:10 neon1024 You can read about that here https://developer.mozilla.org/en-US/docs/Web/API/EventSource
# Jun 20th, 14:10 neon1024 Then I used the EventSource object to write to my progress bar
# Jun 20th, 14:10 neon1024 Then I used PHP to output JSON as it worked, and flushed the buffers so it output constantly
# Jun 20th, 14:09 neon1024 I used the javascript EventSource object
# Jun 20th, 14:09 jeremyharris it;s really whatever you want. if you want a progress bar, having the action return data that you can use to render the progress bar is helpful. Or, if it’s returning the actual HTML of the progress bar you would just pop that into whatever container you’re updating
# Jun 20th, 14:08 joey.mukherjee so my action is returning html. does it have to be json for this to work?
# Jun 20th, 14:07 neon1024 Dunno, I built my own
# Jun 20th, 14:06 joey.mukherjee ?
# Jun 20th, 14:06 joey.mukherjee yes, a progress bar is what I want... Is there an example of that.
# Jun 20th, 14:06 joey.mukherjee oops, yeah, but even without that. it does them all at the end.
# Jun 20th, 14:06 neon1024 I like streaming to a socket, as you can put a progress bar on it :slightly_smiling_face:
# Jun 20th, 14:06 jeremyharris that would only be a problem if the update_movie_status action actually waited until the job was done to return data though
# Jun 20th, 14:05 jeremyharris well.. you have async set to false
# Jun 20th, 14:05 joey.mukherjee it's not updating the page until the end instead of "real time". it is like it isn't Asynchronous. ``` $.ajax ({ url: '/plots/update_movie_status' + ranstr, dataType: 'html', type: 'GET', async: false, ...```
# Jun 20th, 14:00 jeremyharris I would do long polling via ajax just like you’re doing. websockets would work but are overkill likely. what about the ajax idea isn’t working?
# Jun 20th, 13:59 joey.mukherjee is there a preferred CakePHP way of "polling"? (not voting!) basically, I need to update a web page div with output from a (not too) long running process. I am trying with setTimeout and ajax get requests in javascript, but it isn't quite working. it does all the updates after my job has completed!
# Jun 20th, 13:56 joey.mukherjee @nuzulfikrie If you haven't figured it out, you need the Form->create and Form->end, even if you don't use form helper. Also, make sure you are using either the middleware or the component, and not both. I spent a lot of time with these too!
# Jun 20th, 12:30 liaogz82 set the year in 51278
# Jun 20th, 12:30 liaogz82 the test data is too big
# Jun 20th, 12:30 liaogz82 ok I know what is the problem
# Jun 20th, 12:27 graziel what do you send (in $this->request->getData()) ?
# Jun 20th, 12:07 liaogz82 it is suppose to be able to convert it to a proper time in `beforeMarshall()` method
# Jun 20th, 12:04 liaogz82 the above code is sent as timestamp but it always save as `0000-00-00 00:00:00` in the database
# Jun 20th, 12:04 liaogz82 ``` if (isset($data['date_of_birth'])) { $date_of_birth = new Time($data['date_of_birth']); $data['date_of_birth'] = $date_of_birth; } ```
# Jun 20th, 12:03 liaogz82 I cant set cakephp time
# Jun 20th, 12:03 liaogz82 hi guys need some help
# Jun 20th, 11:55 khalid Thanks
# Jun 20th, 11:55 admad it's perfectly all right to use the Traits
# Jun 20th, 11:54 khalid and its not bad practices to use Traits directly in custom classes? according to Cake Conventions?
# Jun 20th, 11:53 khalid Thanks
# Jun 20th, 11:27 edgaras.jan If class/trait is not annotated with `@internal`, it should be backward compatible for at least major version (3.x.x). ModelTrait won't change in 4.x too. Any architecture changes are documented in migration guides in CakePHP documentation
# Jun 20th, 11:16 khalid is there any possibility cake changes the entire architecture? is there any communication or documentation update about these?
# Jun 20th, 11:15 khalid how safe is it to use cakephp core traits in custom Classes, e.g. ModelTrait and so?
# Jun 20th, 11:12 edgaras.jan You should look at docs for Cake2 https://book.cakephp.org/2.0/en/installation/url-rewriting.html
# Jun 20th, 11:09 mehov Second screenshot: could be the messed up web server rewrite rules
# Jun 20th, 11:08 mehov A hotfix may be defining that default value in the database structure, but I don't know if that may break something else down the road
# Jun 20th, 11:06 mehov First screenshot: apparently, `wp_bleuscape` has a `thumbnail_desc` column which needs a value, but you're not providing it. It then tries to revert to a default value to use it instead, but there's none
# Jun 20th, 11:04 noypi2020 Hi, Good day! Can you kindly assist me regarding the query I have with our install that uses CakePHP. I recently updated the CakePHP to version 2.10.18 from version 2.4.4 then now I am getting this error - https://www.screencast.com/t/U9o0J5D5CfIU, when trying to add a new project. Also upon login, I am getting this error which says Missing Controler - https://www.screencast.com/t/GoW8Yxxg0I. Is there anybody who experiences this error?
# Jun 20th, 11:04 slackebot1 Can you kindly share info on how to fix this since I am not familiar on CakePHP. Any help would be much appreciated. Thank you!
# Jun 20th, 10:29 neon1024 Think I’ll stick with filtering by surname initial for the meantime
# Jun 20th, 10:08 neon1024 So far I have a search based on my bloom filter, which works fine, but I’m unsure how to manually narrow down the result set to match. Presumably using a callback, but the callback returns a query, rather than a result set
# Jun 20th, 10:07 neon1024 I am using encrypted fields with a bloom filter, and I have friendsofcake/search implemented. How would I approach creating a search field which returns a manually created subset of data based on my bloom filter?
# Jun 20th, 10:07 nils I’m on 2.x. If I saveAll() using deep it’s not fetching the id from the top. For example. I have Product -> ProductImage (product_id) -> ProductProductImageColor (product_id, product_image_id, color_id). I would like the save to contain the product_id in the ProductProductImageColor Model as well. But it only lands in ProductImage.product_id
# Jun 20th, 09:38 peppejaripappalardo @neon1024 thx for your reply, i will follow the second point, with the option
# Jun 20th, 09:37 neon1024 `$this->Examples->find('published')->find('isLive')->contain(['Extra' => ['Stuff']]);`
# Jun 20th, 09:36 neon1024 You can compose finders
# Jun 20th, 09:36 neon1024 Or I would wrap the finds using my own custom finders in my table classes, which checked the user role using something like muffin/footprint to pass the user data into the table, or just passing the user entity into the finder as an option
# Jun 20th, 09:36 peppejaripappalardo but my problem is that: i have to add custom finder, into a contain, because the entity are related
# Jun 20th, 09:35 neon1024 So I would probably swap the finder based on the user role, if that’s the kinda of approach you’re looking for
# Jun 20th, 09:35 neon1024 If you are using muffin/trash it has a custom finder for finding trashed items
# Jun 20th, 09:35 neon1024 I don’t think that’s a good approach
# Jun 20th, 09:34 peppejaripappalardo @neon1024 its a good way to do? because i need the behaviour for soft cascade delete, but in a certain point of the controller have to unload it, because i can't show the soft-deleted entity
# Jun 20th, 09:30 neon1024 Something like `$this->Examples->behaviors()->unload('Thingy')` if I recall
# Jun 20th, 09:30 neon1024 ..using the BehaviorCollection
# Jun 20th, 09:30 neon1024 Sure, you can unload it from the Table class
# Jun 20th, 09:26 peppejaripappalardo Guys, there is a way to deactivate a Behaviour in a certain point into a controller?
# Jun 20th, 09:01 challgren https://book.cakephp.org/3.0/en/development/routing.html#using-named-routes
# Jun 20th, 09:00 scuadra In Cake 3 which is the preferred migration to named params from Cake 2? I read that Cake 3 still has backwards compatibility to support them but maybe it's better to avoid using them in Cake 3.
# Jun 20th, 08:53 challgren Yeah your at the point where I gave up and just did it all manually
# Jun 20th, 08:51 peppejaripappalardo mm i think is the contain "users", that check if user is deleted and the query will not show it
# Jun 20th, 08:50 challgren Good luck, it sounds like the behavior is modifying the find query
# Jun 20th, 08:49 peppejaripappalardo anyway, thanks for your reply! :slightly_smiling_face:
# Jun 20th, 08:49 peppejaripappalardo but if the user is soft-deleted i get the notice
# Jun 20th, 08:49 peppejaripappalardo if i leave out from the trash, the user tha query work fine
# Jun 20th, 08:49 challgren I started off using that plugin and then just went the manual way
# Jun 20th, 08:48 challgren Hmm at this point Im not sure
# Jun 20th, 08:47 peppejaripappalardo yes, this one: Notice (8): Trying to get property of non-object [APP/Template/Volunteers/index.ctp, line 85], that is because i have soft deleted the user
# Jun 20th, 08:46 challgren A warning?
# Jun 20th, 08:45 peppejaripappalardo without the matching it is working, but i get a warning for the user, because it is soft deleted
# Jun 20th, 08:44 challgren Try removing the matching part for now and see if your contains are correct.