Trouble with jQuery 3.5.0

Trouble with jQuery 3.5.0

ComGreedComGreed Posts: 15Questions: 3Answers: 1

I just want to notify other people that I ran into a little bit of trouble with the newest version of jQuery combined DataTables Editor. In my case the multi-value div block was not inserted into the field of the editor when I edited multiple rows at once that have different data in theses fields. Rolling back to jQuery 3.4.1 fixed this issue. I think it has to do with the security fix in 3.5.0 since it has something to with HTML insertion into the DOM.

Sorry that I can't provide an example right now because I'm on a deadline.

Changelog is here: https://blog.jquery.com/2020/04/10/jquery-3-5-0-released/

Replies

  • allanallan Posts: 61,972Questions: 1Answers: 10,160 Site admin

    Thanks for posting this up! I will be looking at this shortly and will post an update. We plan on doing a patch release before the end of the month, and I'll be sure to run jQuery 3.5.0 through our unit tests as well as looking at this manually.

    Thanks,
    Allan

  • kanweikanwei Posts: 14Questions: 4Answers: 0

    Yup, just ran into this issue as well. The bubble editor looks totally messed up (everything is 45 degrees slanted) and clicking "Update" doesn't work.

  • allanallan Posts: 61,972Questions: 1Answers: 10,160 Site admin

    Just been looking at this, and I used short tags (<div/>) anywhere it made sense in XHTML terms, in order to try and reduce the byte count just a little. jQuery never had a problem with this before since it would assume XHTML and convert to HTML5 if needed. That is no longer the case, so this is a fairly major breaking change for us.

    The good news is that I've committed the fixes required for Editor and it will be in 1.9.3 next week. Unit tests are all passing for Editor with this change and jQuery 3.5.0. I'm about to run through the tests for the other libraries with jQuery 3.5 as I suspect that won't be the only change we need to make.

    Allan

  • allanallan Posts: 61,972Questions: 1Answers: 10,160 Site admin

    Actually, the unit tests are passing on everything else - Editor's HTML is just more complex than the other extensions... We'll keep an eye out, but if you do see anything else, just shout.

    Allan

  • svierkantsvierkant Posts: 33Questions: 2Answers: 0

    I've got troubles too. I'm using Webpack. It worked with jQuery 3.4.1, but with jQuery 3.5.0 I've got this message:

    Uncaught TypeError: Cannot read property 'defaults' of undefined
    at dataTables.bootstrap.js:47

    Line 47:
    https://github.com/DataTables/Dist-DataTables-Bootstrap/blob/1.10.20/js/dataTables.bootstrap.js#L47

    I'm using Datatables 1.10.20

    My datatables.js:

    import 'datatables.net/js/jquery.dataTables'
    import 'datatables.net-bs/js/dataTables.bootstrap'
    
  • colincolin Posts: 15,179Questions: 1Answers: 2,590

    Interesting, thanks for reporting. Are you able to link to your page or create a test case so we can debug, please. If not, could you run the debugger and post the code, please.

    Colin

  • sachielsachiel Posts: 2Questions: 0Answers: 0

    With jQuery 3.5.1, on the Editor, the Upload button does nothing when clicked, but you can still drop a photo or file into the space.

  • allanallan Posts: 61,972Questions: 1Answers: 10,160 Site admin

    Hi,

    That will be fixed with Editor 1.9.3 which will drop shortly.

    Regards,
    Allan

  • goncalomarrafagoncalomarrafa Posts: 9Questions: 1Answers: 0

    I'm also having the same problem as @svierkant with webpack.

  • allanallan Posts: 61,972Questions: 1Answers: 10,160 Site admin

    Have you got a test case in a repo I can use to reproduce this, or even just the sequence of commands you are using and the webpack config? I don't know why jQuery 3.5 would make a difference here compared to 3.4.

    Allan

  • chrislambertukchrislambertuk Posts: 3Questions: 2Answers: 0

    I have the same problem, it's not just with Editor.

    It seems to be an acknowledged bug in JQuery https://github.com/jquery/jquery/issues/4665 "breaks projects that depend on hasOwnProperty() function availability"

    A typical stack dump is here:
    Uncaught TypeError: b.hasOwnProperty is not a function at Ya (jquery.dataTables.min.js:75) at HTMLTableElement.<anonymous> (jquery.dataTables.min.js:85) at Function.each (jquery.php?tseed=5bb1a98b139b46abd22c69cae01d7704:2) at S.fn.init.each (jquery.php?tseed=5bb1a98b139b46abd22c69cae01d7704:2) at S.fn.init.n [as dataTable] (jquery.dataTables.min.js:83) at S.fn.init.h.fn.DataTable (jquery.dataTables.min.js:166) at init_datatables (js.php?t=dokuwiki&tseed=0ee23f041b35529f2b1966aea4e1bf4e:1) at HTMLTableElement.<anonymous> (js.php?t=dokuwiki&tseed=0ee23f041b35529f2b1966aea4e1bf4e:1) at Function.each (jquery.php?tseed=5bb1a98b139b46abd22c69cae01d7704:2) at S.fn.init.each (jquery.php?tseed=5bb1a98b139b46abd22c69cae01d7704:2)

    This is using datatables in dokuwiki plugin https://www.dokuwiki.org/plugin:datatables & JQuery 3.5.0, i.e. (console.log(jQuery().jquery); displays 3.5.0.

    I've found that if no datatables options are set it works fine, i.e. with Length, Filtering, Info, Pagination & Processing al showing & working.

    But if I explicitly set any of those options hasOwnProperty is not a function pops up on console & the datatables features disappear :-(

  • colincolin Posts: 15,179Questions: 1Answers: 2,590

    We're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.

    Cheers,

    Colin

This discussion has been closed.