Closed georgmaisser closed 3 months ago
At least 2 potential issues (occured on my dev, not confirmed at other instances):
if $paginationset == true $totalrecords not updated and remains == 0...
Hi Andrii, just to be sure: The issues above are solved, no?
@georgmaisser I will need pull latest changes and to check again. But at least on Sunday I still had problem with waiting list on my dev.
@georgmaisser I have made an additional debugging... Noticed that when I vizit ""book other user" page the query_db_cached() method of wunderbyte_table class of wb_talbe plugin called TWICE in a row.
$this->cachecomponent = "mod_booking"
$this->rawcachename = "bookedusertable"
$cachekey = "488148699_sqlquery"
$paginationset = false
"SELECT COUNT(1) FROM (SELECT ba.id, u.id as userid, u.firstname, u.lastname, u.email, ba.timemodified, ba.timecreated, ba.optionid, ba.json FROM {booking_answers} ba JOIN {user} u ON ba.userid = u.id WHERE ba.optionid=:optionid AND ba.waitinglist=:statusparam ORDER BY ba.timemodified, ba.id ASC ) s1 WHERE 1=1 "
optionid: 261 statusparam: 2
$total = $grandtotal = 0 $this->rawdata = 0
$this->totalrecords = 0
Such as $paginationset = false $this->set_pagination_to_cache has been executed so totalrecords = 0 cached
- 2nd pass
$this->cachecomponent = "mod_booking" $this->rawcachename = "bookedusertable" $cachekey = "488148699_sqlquery" $paginationset = true (!!!)
"SELECT COUNT(1) FROM (SELECT ba.id, u.id as userid, u.firstname, u.lastname, u.email, ba.timemodified, ba.timecreated, ba.optionid, ba.json FROM {booking_answers} ba JOIN {user} u ON ba.userid = u.id WHERE ba.optionid=:optionid AND ba.waitinglist=:statusparam ORDER BY ba.timemodified, ba.id ASC ) s1 WHERE 1=1 "
optionid: 261 statusparam: 1
$total = $grandtotal = 2 $this->rawdata = array(2)
$this->totalrecords = 0 (ERROR!)
Such as $paginationset = true $this->set_pagination_to_cache has NOT been executed so totalrecords = 0 remains in cache abd used despite 2 records available,
Could 2 pass be related to 2 rows there:
![Image](https://github.com/Wunderbyte-GmbH/moodle-mod_booking/assets/1571998/5eda78d9-e405-4c5e-838e-f29add6ba18f)
but I cannot figure-out what setting is responsible for "Users with short reservations"
"Users with shortterm reservations" are users who currently have the item in their shopping cart.
@bernhard-wunderbyte Tnahk you for above clarification. How about 2 passes for waitinglist with differnt statuscodes? If 2 different datasets expected (by statusparam)- why 1 cache had been used?
@georgmaisser Can you help @semteacher with this?
(above commit related to another issue and had updated already)
Finally working on my dev env. too