Log message #4190361

# At Username Text
# Jun 20th 2019, 14:14 jeremyharris gotcha
# Jun 20th 2019, 14:14 neon1024 After 11 I believe
# Jun 20th 2019, 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 2019, 14:13 neon1024 Tbh caniuse is probably more accurate
# Jun 20th 2019, 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 2019, 14:13 neon1024 Hmm
# Jun 20th 2019, 14:13 jeremyharris for better or for worse
# Jun 20th 2019, 14:13 jeremyharris but yeah it’s all going to be 2 engines in not too long
# Jun 20th 2019, 14:13 neon1024 I guess that’s why they are stealing the Chrome JS engine :)
# Jun 20th 2019, 14:13 jeremyharris caniuse shows promises are in there
# Jun 20th 2019, 14:13 neon1024 They’re now so far behind the JS curve it’s not even worth considering them
# Jun 20th 2019, 14:12 neon1024 Even basic stuff like fetch and promises aren’t in
# Jun 20th 2019, 14:12 neon1024 They gave up in like IE7
# Jun 20th 2019, 14:12 neon1024 Well yeah Microsoft just can’t work Javascript it seems
# Jun 20th 2019, 14:12 neon1024 Be sure to note the browser compatibility!
# Jun 20th 2019, 14:12 jeremyharris no support in edge at all sadly
# Jun 20th 2019, 14:11 jeremyharris that’s cool :nerd_face:
# Jun 20th 2019, 14:10 neon1024 You can read about that here https://developer.mozilla.org/en-US/docs/Web/API/EventSource
# Jun 20th 2019, 14:10 neon1024 Then I used the EventSource object to write to my progress bar
# Jun 20th 2019, 14:10 neon1024 Then I used PHP to output JSON as it worked, and flushed the buffers so it output constantly
# Jun 20th 2019, 14:09 neon1024 I used the javascript EventSource object
# Jun 20th 2019, 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 2019, 14:08 joey.mukherjee so my action is returning html. does it have to be json for this to work?
# Jun 20th 2019, 14:07 neon1024 Dunno, I built my own
# Jun 20th 2019, 14:06 joey.mukherjee ?
# Jun 20th 2019, 14:06 joey.mukherjee yes, a progress bar is what I want... Is there an example of that.
# Jun 20th 2019, 14:06 joey.mukherjee oops, yeah, but even without that. it does them all at the end.
# Jun 20th 2019, 14:06 neon1024 I like streaming to a socket, as you can put a progress bar on it :slightly_smiling_face:
# Jun 20th 2019, 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 2019, 14:05 jeremyharris well.. you have async set to false
# Jun 20th 2019, 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 2019, 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 2019, 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 2019, 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 2019, 12:30 liaogz82 set the year in 51278
# Jun 20th 2019, 12:30 liaogz82 the test data is too big
# Jun 20th 2019, 12:30 liaogz82 ok I know what is the problem
# Jun 20th 2019, 12:27 graziel what do you send (in $this->request->getData()) ?
# Jun 20th 2019, 12:07 liaogz82 it is suppose to be able to convert it to a proper time in `beforeMarshall()` method
# Jun 20th 2019, 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 2019, 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; } ```