Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin does not work any more after update to Hogfather #51

Closed
tmo26 opened this issue Jun 5, 2020 · 14 comments
Closed

Plugin does not work any more after update to Hogfather #51

tmo26 opened this issue Jun 5, 2020 · 14 comments

Comments

@tmo26
Copy link

tmo26 commented Jun 5, 2020

Problem: After update from Greebo to Hogfather, datatables functions are not available any more, e.g. search-field on the right side of the table is missing.
Debugger shows TypeError: $thead.size is not a function:

Example page: https://openwrt.org/meta/fwfiles_datatable

Console output:
grafik
(some png/gif loading skipped)
grafik

Debugger output:
grafik

@giterlizzi
Copy link
Owner

Hi,
Hogfather now use the "defer" attribute for speedup the JS loading but this attribute break some plugins.
You can temporary disable the defer attribute using defer_js option in Configuration Manager (see https://www.dokuwiki.org/config:defer_js).

I'm working to release a new version of plugin with an updated version of DataTables and a fix for this issue without a workaround.

@tmo26
Copy link
Author

tmo26 commented Jun 6, 2020

You can temporary disable the defer attribute using defer_js option in Configuration Manager (see https://www.dokuwiki.org/config:defer_js).

The above result is already with defer_js unchecked.

@tmo26
Copy link
Author

tmo26 commented Jun 17, 2020

I just rechecked with the latest master

Installed version: 2020-06-14
Your last update: Wed, 17 Jun 2020 14:58:15 +0000

with defer_fs checked and unchecked, the datatables search-field is not there.

@giterlizzi
Copy link
Owner

Please paste the errors in JS console.

@tmo26
Copy link
Author

tmo26 commented Jun 17, 2020

grafik

@chris-lambert-shiels
Copy link

Same issue here.
Also noticed that iIf the tag has no attribute such as paging, or the attribute value is junk paging="junk" then the defaul Search box and Page Length selector appear. But if paging="true" then the Datatables functionality is lost. So might it be a parsing issue?
JS Console below
DevTools failed to load SourceMap: Could not parse content for https://stbens-glastonbury.uk/wiki/lib/plugins/datatables/assets/pdfmake/build/pdfmake.min.js.map: Unexpected token < in JSON at position 0 jquery.php?tseed=5bb1a98b139b46abd22c69cae01d7704:2 jQuery.Deferred exception: b.hasOwnProperty is not a function TypeError: b.hasOwnProperty is not a function at Ya (https://stbens-glastonbury.uk/wiki/lib/plugins/datatables/assets/datatables.net/js/jquery.dataTables.min.js:75:377) at HTMLTableElement.<anonymous> (https://stbens-glastonbury.uk/wiki/lib/plugins/datatables/assets/datatables.net/js/jquery.dataTables.min.js:85:455) at Function.each (https://stbens-glastonbury.uk/wiki/lib/exe/jquery.php?tseed=5bb1a98b139b46abd22c69cae01d7704:2:2976) at S.fn.init.each (https://stbens-glastonbury.uk/wiki/lib/exe/jquery.php?tseed=5bb1a98b139b46abd22c69cae01d7704:2:1454) at S.fn.init.n [as dataTable] (https://stbens-glastonbury.uk/wiki/lib/plugins/datatables/assets/datatables.net/js/jquery.dataTables.min.js:83:388) at S.fn.init.h.fn.DataTable (https://stbens-glastonbury.uk/wiki/lib/plugins/datatables/assets/datatables.net/js/jquery.dataTables.min.js:166:333) at init_datatables (https://stbens-glastonbury.uk/wiki/lib/exe/js.php?t=dokuwiki&tseed=54ed5ba6f8aca9f150e405c7e17174b2:1:98658) at HTMLTableElement.<anonymous> (https://stbens-glastonbury.uk/wiki/lib/exe/js.php?t=dokuwiki&tseed=54ed5ba6f8aca9f150e405c7e17174b2:1:99190) at Function.each (https://stbens-glastonbury.uk/wiki/lib/exe/jquery.php?tseed=5bb1a98b139b46abd22c69cae01d7704:2:2976) at S.fn.init.each (https://stbens-glastonbury.uk/wiki/lib/exe/jquery.php?tseed=5bb1a98b139b46abd22c69cae01d7704:2:1454) undefined S.Deferred.exceptionHook @ jquery.php?tseed=5bb1a98b139b46abd22c69cae01d7704:2 t @ jquery.php?tseed=5bb1a98b139b46abd22c69cae01d7704:2 setTimeout (async) (anonymous) @ jquery.php?tseed=5bb1a98b139b46abd22c69cae01d7704:2 c @ jquery.php?tseed=5bb1a98b139b46abd22c69cae01d7704:2 fireWith @ jquery.php?tseed=5bb1a98b139b46abd22c69cae01d7704:2 fire @ jquery.php?tseed=5bb1a98b139b46abd22c69cae01d7704:2 c @ jquery.php?tseed=5bb1a98b139b46abd22c69cae01d7704:2 fireWith @ jquery.php?tseed=5bb1a98b139b46abd22c69cae01d7704:2 ready @ jquery.php?tseed=5bb1a98b139b46abd22c69cae01d7704:2 B @ jquery.php?tseed=5bb1a98b139b46abd22c69cae01d7704:2 jquery.php?tseed=5bb1a98b139b46abd22c69cae01d7704:2 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=54ed5ba6f8aca9f150e405c7e17174b2:1) at HTMLTableElement.<anonymous> (js.php?t=dokuwiki&tseed=54ed5ba6f8aca9f150e405c7e17174b2:1) at Function.each (jquery.php?tseed=5bb1a98b139b46abd22c69cae01d7704:2) at S.fn.init.each (jquery.php?tseed=5bb1a98b139b46abd22c69cae01d7704:2)

@chris-lambert-shiels
Copy link

As above removing attributes from the <datatables> tag makes the "TypeError: b.hasOwnProperty is not a function" go away. The stack dump suggests the problem is in jquery 3.5.0 - e.g. see snapappointments/bootstrap-select#2430

@chris-lambert-shiels
Copy link

OK so it is in Jquery jquery/jquery#4665
"an unintended breaking change that we should fix in 3.5.1"

@chris-lambert-shiels
Copy link

Seems like it's an epidemic, e.g.

The latter says "currently downgrading jQuery from 3.5.0 to 3.4.1 is the only option until 3.5.1 is released"

Could someone cleverer than me say how to do this - e.g. datatables / dokuwiki on Debian in my case?

@chris-lambert-shiels
Copy link

@ScottOfford
Copy link

ScottOfford commented Jun 30, 2020

I've been able to get it working by editing the file /lib/plugins/datatables/assets/datatables.net/js/jquery.dataTables.min.js and replacing the following items:
a.hasOwnProperty(d) with Object.prototype.hasOwnProperty.call(a,d)
b.hasOwnProperty(e) with Object.prototype.hasOwnProperty.call(b,e)
i.hasOwnProperty(a) with Object.prototype.hasOwnProperty.call(i,a)

DocuWiki version Release rc-2020-06-09 "Hogfather" RC3
Installed plugin version: 2020-06-14

pastebin of my edited file here.

This was suggested as a fix here

@tmo26
Copy link
Author

tmo26 commented Jun 30, 2020

@ScottOfford I can confirm that your changes bring back the search field (although on the left side of the page, whereas is should be on the right side). Thanks for that! :)

Pagination however does not work correctly: there are no links behind the pagenumbers:
grafik

@giterlizzi
Copy link
Owner

@ChrisLambertUK

dokuwiki/dokuwiki#3192

@tmo26
Copy link
Author

tmo26 commented Feb 17, 2021

Issue solved with
Release 2020-07-29 "Hogfather"
Bootstrap3 Template v2020-08-28 (develop/20210113)
Datatables plugin Installed version: 2020-06-14

  • Search field on the right side is showing up
  • pagination buttons are visible and working

@tmo26 tmo26 closed this as completed Feb 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants