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

Use of %TOTALPAGES% in results header or footer causes both to disappear #144

Closed
CrystalClearGal opened this issue Mar 21, 2022 · 9 comments · Fixed by #145
Closed

Use of %TOTALPAGES% in results header or footer causes both to disappear #144

CrystalClearGal opened this issue Mar 21, 2022 · 9 comments · Fixed by #145
Assignees
Labels
bug Something isn't working

Comments

@CrystalClearGal
Copy link

Private (Miraheze) wiki (dmlwiki.miraheze.org)
MediaWiki: 1.37.1 (d3eca0f)18:37, 17 March 2022
PHP: 7.4.28 (fpm-fcgi)
MariaDB: 10.5.15-MariaDB-1:10.5.15+maria~bullseye-log
DPL3: 3.4.2 (e7113a2) 15:40, 17 March 2022

Use of %TOTALPAGES% in resultsheader or resultsfooter causes the contents of both to disappear, even if %TOTALPAGES% is only used in one (needing to use it with scroll to paginate). Strangely, it shows in debug with debug=5 but not in page source. When showing in debug, the totalpages count is incorrect, it displays 1. Removing results header or footer will cause both to reappear on-page and in page source.

You are more than welcome to view/test/change the example live : )
That can be done at this link (if helpful):
https://dmlwiki.miraheze.org/wiki/User:CrystalClear/Sandbox11

Otherwise, how to reproduce:

|category = Epic (classification)
|uses=Template:DragonBox
|mode = userformat
|count = {%DPL_count:5%}
|scroll = yes
|resultsheader = Pages in result: %PAGES% \n
|resultsfooter = Total pages: %TOTALPAGES% \n
|table = class="wikitable sortable {{{classes|}}}" style="border:unset;", Dragon, 1st, 2nd, 3rd
|includepage = {DragonBox}:base:second:third
|tablerow = %%,%%,%%,
}}```
@Universal-Omega
Copy link
Owner

Thank you for the report. I'll look into this shortly.

I swear though, I fix one bug, and 2 more pop up...

@CrystalClearGal
Copy link
Author

CrystalClearGal commented Mar 21, 2022

You're welcome. I remember the last maintainer (Alexa) commenting that some fixes were going to take some time, so perhaps its code has needed a bit of an overhaul for a while prior to your adoption.

Folks are grateful to have it updated, thanks for taking on its maintenance, it is definitely running smoother and faster since your recent updates. Scroll had been broken for ages, so having that fixed is also a massive bonus. I was pretty stoked when I saw that change. :)

@Universal-Omega
Copy link
Owner

@Universal-Omega Universal-Omega self-assigned this Mar 21, 2022
@Universal-Omega Universal-Omega added the bug Something isn't working label Mar 21, 2022
@CrystalClearGal
Copy link
Author

CrystalClearGal commented Mar 22, 2022

Is this version maybe not on Miraheze yet? Or maybe it was on MH but then reverted to last version? I ask because my resultsheader and resultsfooter showed up for a short period on MH then disappeared again. Do I need to test instead on standalone MW 1.35-1.37 to test the latest version?

Also, the %TOTALPAGES% count has not been corrected, it still reports 1 result, in the entire result set of 418, when it is supposed to return the total number of pages in the result set regardless of the count param. But, maybe that's because I'm checking on MH and MH might not have the latest version.

I wasn't sure if I needed to create a separate task for this or not? If so, happy to do.

@Universal-Omega
Copy link
Owner

Is this version maybe not on Miraheze yet? Or maybe it was on MH but then reverted to last version? I ask because my resultsheader and resultsfooter showed up for a short period on MH then disappeared again. Do I need to test instead on standalone MW 1.35-1.37 to test the latest version?

Also, the %TOTALPAGES% count has not been corrected, it still reports 1 result, in the entire result set of 418, when it is supposed to return the total number of pages in the result set regardless of the count param. But, maybe that's because I'm checking on MH and MH might not have the latest version.

I wasn't sure if I needed to create a separate task for this or not? If so, happy to do.

I added some tests to the CI, which confirm a correct %TOTALPAGES% output now, provided that was accurate. It should fix it disappearing the header and footer, as well as the issue with it only returning one result. However no, it is not deployed on Miraheze yet.

@CrystalClearGal
Copy link
Author

Great, thanks for the fix and thanks for confirming! When we get our 1.35.5 dev/test site running we'll give it a go there. :)

@Universal-Omega
Copy link
Owner

Great, thanks for the fix and thanks for confirming! When we get our 1.35.5 dev/test site running we'll give it a go there. :)

You're welcome. FYI, it has now been updated on Miraheze, where I can confirm it does now work correctly.

@CrystalClearGal
Copy link
Author

Sorry to be the bearer or bad news... I thought this was working also, but discovered that %TOTALPAGES% still intermittently causes resultsheader and resultsfooter to drop off, just not until several page saves later (you're welcome to test it at the same link from above, I put an example there). I had it working great, it wasn't until subsequent edits and saves, that they dropped off again, though I haven't tested on MW 1.35.5, just on Miraheze.

The workaround for categories where a set number of pages is known, would be to replace %TOTALPAGES% with:
{{formatnum:{{PAGESINCATEGORY:Mycategory}}¦R}}
(Though of course it won't work when the result set number is unknown)

@Universal-Omega
Copy link
Owner

If I had to guess, the inconsistencies is due to it all being cached using query cache. I'm afraid the only full solution here may actually be no caching, which of course isn't worth a full fix for this, if it causes regression to all of the performance issues DPL3 previously caused. If this is indeed the cause, then I'm afraid I'm not sure I'll come up with a fix for this, unfortunately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants