froot Posted November 26, 2022 Share Posted November 26, 2022 I'm having difficulties paging/paginating an array of pages inside a process module. (template "admin") In the frontend, this seems to be more straightforward, but in admin, it seems to not know the segments. It shows the pager, it limits the results, however when I click on the next or any page it says "ProcessWire: Unrecognized path" and "Der Prozess hat keinen Inhalt ausgegeben." or something. The URL adds the segment /Seite2/ I thought I'd just have to allow pagination and segments in the settings of the listed pages's template, like I'm used to, but no, there must be more to it. Has anyone been there? Also, in other modules (not mine) I can see the pagination not working either. If I click on another page inside the pager, it reloads the same page. Link to comment Share on other sites More sharing options...
bernhard Posted November 26, 2022 Share Posted November 26, 2022 I thought pagination was not meant to work on the backend but I just tried and it seems to work just as expected. I didn't do any settings regarding url segments... https://github.com/baumrock/PaginationDemo 1 Link to comment Share on other sites More sharing options...
froot Posted November 26, 2022 Author Share Posted November 26, 2022 OK but does it work when you click on 2, 3, 4… ? Cause I get it to look as in your demo but the links don't work. What are you doing differently? Link to comment Share on other sites More sharing options...
bernhard Posted November 26, 2022 Share Posted November 26, 2022 Yes, of course. That was what you where asking for and what I was testing. Link to comment Share on other sites More sharing options...
kongondo Posted November 26, 2022 Share Posted November 26, 2022 3 hours ago, bernhard said: I thought pagination was not meant to work on the backend Why would you think so? Pagination has been available in the backend ever since I can remember. Lister (page finder) uses pagination ?. I also know this since I have been using pagination in my modules. Link to comment Share on other sites More sharing options...
bernhard Posted November 26, 2022 Share Posted November 26, 2022 I've just never had the need for it ? And can't remember I've seen it somewhere. But nice to know it's possible - maybe it will be helpful one day ? Link to comment Share on other sites More sharing options...
kongondo Posted November 26, 2022 Share Posted November 26, 2022 Just adding that the pagination I am talking about in Lister is ajax powered. Link to comment Share on other sites More sharing options...
bernhard Posted November 26, 2022 Share Posted November 26, 2022 Yeah I know that one of course but don't know how this works and would be thankful to get a pointer ? Link to comment Share on other sites More sharing options...
kongondo Posted November 26, 2022 Share Posted November 26, 2022 2 minutes ago, bernhard said: Yeah I know that one of course but don't know how this works and would be thankful to get a pointer ? I'll see if I can come up with something later... Link to comment Share on other sites More sharing options...
froot Posted November 26, 2022 Author Share Posted November 26, 2022 but why don't the links work? And what about other modules that use pagination in the admin backend, why does their pagination not work either and do they not use Process class? Link to comment Share on other sites More sharing options...
kongondo Posted November 26, 2022 Share Posted November 26, 2022 25 minutes ago, fruid said: what about other modules that use pagination in the admin backend, why does their pagination not work either and do they not use Process class? Do you have examples of modules whose pagination do not work? Link to comment Share on other sites More sharing options...
froot Posted November 26, 2022 Author Share Posted November 26, 2022 59 minutes ago, kongondo said: Do you have examples of modules whose pagination do not work? in one PW project of mine, none of them work. I mean name any module that shows a pagination in the admin backend and the pagination doesn't work, core or site module. My guess is it has to do with some sort of redirect somewhere though I cannot make out where and why. Lister Pro module for example at least shows an error: {"error":false,"message":"Unknown Lister action"} Link to comment Share on other sites More sharing options...
kongondo Posted November 26, 2022 Share Posted November 26, 2022 33 minutes ago, fruid said: Lister Pro module for example at least shows an error: {"error":false,"message":"Unknown Lister action"} That would definitely be a bug. Lister Pro needs pagination. What ProcessWire version? Link to comment Share on other sites More sharing options...
froot Posted November 26, 2022 Author Share Posted November 26, 2022 PW 3.0.200 PHP 7.3 MySQL 5.7 if that helps Link to comment Share on other sites More sharing options...
zoeck Posted November 26, 2022 Share Posted November 26, 2022 Im not sure, but you can activate the pagination inside of the „admin“ (System) Template. Link to comment Share on other sites More sharing options...
froot Posted November 26, 2022 Author Share Posted November 26, 2022 22 minutes ago, zoeck said: Im not sure, but you can activate the pagination inside of the „admin“ (System) Template. I thought about that too, but I doubt that solves the bug or what it is. Also, it's not like the admin template is listed among all other templates for me to edit. Link to comment Share on other sites More sharing options...
kongondo Posted November 26, 2022 Share Posted November 26, 2022 (edited) 59 minutes ago, zoeck said: Im not sure, but you can activate the pagination inside of the „admin“ (System) Template. Admin template already allows page numbers. Whatever is happening is a bug (but I am yet to try and replicate to rule out 'implementation'). 35 minutes ago, fruid said: I thought about that too, but I doubt that solves the bug or what it is. Also, it's not like the admin template is listed among all other templates for me to edit. Setup > Templates > Filters: Show system templates. Edited November 26, 2022 by kongondo 1 Link to comment Share on other sites More sharing options...
froot Posted November 26, 2022 Author Share Posted November 26, 2022 3 hours ago, fruid said: My guess is it has to do with some sort of redirect somewhere though I cannot make out where and why. …with that in mind, does that look weird to you? also, whenever I echo anything outside the <content></content> tag, it's echoed twice. I'm using markup regions BTW. It might not seem related, but I think it's worth mentioning in this context. Link to comment Share on other sites More sharing options...
kongondo Posted November 26, 2022 Share Posted November 26, 2022 Tested @bernhard and it works fine Screenshots Environment PHP 8.1.10 ProcessWire 3.0.203 MySQL 8.0.30 1 Link to comment Share on other sites More sharing options...
froot Posted November 27, 2022 Author Share Posted November 27, 2022 I'm positive it has nothing to do with Lister Pro per se because like I said, the pagination doesn't work for any module that uses pagination in this installation. Also pretty sure it has nothing to do with the PHP version, it's the same PHP version for all other projects with no issues elsewhere. (MAMP sets one version for all projects) PW version is 200 which is the master version. MySQL version is also 5.7 for this and all other projects, so I guess I can rule this out too. Other things I've tried: exclude ready.php (maybe some hooks are messing up the admin) – no changes exclude init.php (probably pointless cause that's just for frontend?) – no changes I'm out of ideas Link to comment Share on other sites More sharing options...
kongondo Posted November 27, 2022 Share Posted November 27, 2022 I have also tested with 3.0.200 and it works fine. 1 hour ago, fruid said: I'm out of ideas I'd suggest starting on a clean install in a similar environment but without any custom modules. Test that. If it works, add your custom modules one by one as you test each time you add a module. This is bound to reveal the cause. Link to comment Share on other sites More sharing options...
froot Posted November 27, 2022 Author Share Posted November 27, 2022 I feel like I tried everything at this point. Install a fresh PW (200) with new database and one by one install the same modules as in the broken installation and test if at some point the pagination stops working. But it always works. And I tried the other way around. I duplicated the broken installation's database and pointed the new installation to that database. As expected, the pagination doesn't work then. Then I UNinstalled all the modules one by one. But pagination never works. Uninstalling the modules, deleting the modules, clearing cache, compiled files. Deleting unused fields, unused templates, deleting all modules that require an update according to the diagnostics module. Uninstalling and deleting the diagnostics module, uninstalling and deleting Tracy Debugger. Nothing helps. Tried in different browsers too. Cleared cookies, cache, all the good stuff. The only issue I ran into when uninstalling all fields and template that used some special module was this: Dangit… Fatal Error: Uncaught Error: Call to a member function set() on null in site/modules/FieldtypeColorPicker/FieldtypeColorPicker.module:46 I must have uninstalled some field or module that is required to edit the field in question. Don't know what though and I think I can assume that that's not the issue. Now I cannot edit the field, thus cannot delete it. Anyway, I'm again, out of ideas. Is my database corrupted? Diagnostics says it's fine. Are there too many entries for PW to handle? BTW, what does that mean? (ProcessDiagnostics) P.S. This is what I dislike about this work/job/career. I can handle and enjoy logical errors because that just requires thinking and reasoning. But Debugging is basically searching for a needle in a haystack, it takes hours, days or weeks until you solve the problem and when it's done, the work that went into it is pretty much invisible to the client so it's hard or impossible to put a price on it, after all, I chose the tool that I would work with. Link to comment Share on other sites More sharing options...
gebeer Posted November 28, 2022 Share Posted November 28, 2022 When you tested in the fresh PW install, did you also copy all the code in site/templates, site/ready.php, site/init.php from the affected install to the fresh install? Or in other words, can you rule out with certainty that template or hook code might be responsible, especially hooks? I once stumbled over a similar or at least related problem, where all PW queries in the page tree, that are done via ajax returned an error and pages tree stopped working. Then I discovered that an addHookBefore('ProcessHome::execute', $this, 'rootPage') was responsible. In my hook function 'rootPage', I had to do an if($this->config->ajax) return; This is just what came to my mind when reading about your problem. 11 hours ago, fruid said: BTW, what does that mean? (ProcessDiagnostics) Did you follow the "Optimize" link and which table is this warning referring to? 11 hours ago, fruid said: Are there too many entries for PW to handle? How many entries are there in the DB table "pages"? I can totally understand your frustration and think we all have been there at some point. But, at least for me, all those situations were resolvable in the end. Even if we cannot charge our clients for the effort we put in resolving those issues, these situations can help us to learn and get better at what we are doing. 2 Link to comment Share on other sites More sharing options...
froot Posted November 28, 2022 Author Share Posted November 28, 2022 I can rule out the effects of ready.php and init.php, I didn't try yet with all other template files but will do so today, I think that's the next logical step. But then also, in the second attempt I described, where I just use the same database and none of the files from the file system, it doesn't work either. So if you think about it, the files couldn't be the problem either. That's why I have to assume that the issue lies in the database, but I wouldn't know how to go about finding the problem let alone repairing the database. Like I said, the diagnostic tool says it's fine. 5 hours ago, gebeer said: Did you follow the "Optimize" link and which table is this warning referring to? 16 hours ago, fruid said: I clicked on it, but not much seems to happen other than that the warning disappears. But it returns eventually. Can't say for sure what table it is in the db (cause right now the warnings are gone) but often times it's a some cache. 6 hours ago, gebeer said: 17 hours ago, fruid said: Are there too many entries for PW to handle? Some pages of a certain template amount to 4 digits, if I filter anything that has an ID it amounts to 8000 something, so that can't be it either. Link to comment Share on other sites More sharing options...
gebeer Posted November 28, 2022 Share Posted November 28, 2022 27 minutes ago, fruid said: but often times it's a some cache. 6 hours ago, gebeer said: Try clearing the cache table in the DB. Just a guess but won't do any harm and maybe it helps. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now