Cannot view last pet

Forum
Last Post
Threads / Messages

Dinocanid

Member
Member
Joined
Aug 30, 2016
Messages
520
Points
18
Age
23
Location
Maryland, USA
Mysidian Dollar
43,334
One of my users reported not being able to view/manage their last pet, and clicking the next page pagination just shows the last pet from the first page. (They have 16, but can only see 15) The pet they can't see is their favorite/active pet if that helps.
PHP:
	public function index(){
	    $mysidia = Registry::get("mysidia");
		$total = $mysidia->db->select("owned_adoptables", array("aid"), "owner = '{$mysidia->user->username}'")->rowCount();
		$pagination = new Pagination($total, 10, "myadopts");
        $pagination->setPage($mysidia->input->get("page"));	
        
        //Attempting to sort!
        $sort = $mysidia->db->select("users_options", array("petsort"), "username = '{$mysidia->user->username}'")->fetchColumn();
            switch ($sort){
    case 'clicks': 
        $stmt = $mysidia->db->select("owned_adoptables", array("aid"), "owner = '{$mysidia->user->username}' ORDER BY totalclicks LIMIT {$pagination->getLimit()},{$pagination->getRowsperPage()}");
        break;
	case 'gender': 
	    $stmt = $mysidia->db->select("owned_adoptables", array("aid"), "owner = '{$mysidia->user->username}' ORDER BY gender LIMIT {$pagination->getLimit()},{$pagination->getRowsperPage()}"); 
	    break;
	case 'level': 
	    $stmt = $mysidia->db->select("owned_adoptables", array("aid"), "owner = '{$mysidia->user->username}' ORDER BY currentlevel LIMIT {$pagination->getLimit()},{$pagination->getRowsperPage()}");
	    break;
	case 'name': 
	    $stmt = $mysidia->db->select("owned_adoptables", array("aid"), "owner = '{$mysidia->user->username}' ORDER BY name LIMIT {$pagination->getLimit()},{$pagination->getRowsperPage()}");
	    break;
}
		
		//Sorting ends here!
		$this->setField("pagination", $pagination);
        $this->setField("stmt", new DatabaseStatement($stmt));
	}
(myadopts.php)
Continued in next post...
 
I think sometimes what happens is with the sort feature it randomises the pets on each page (so sometimes some pets that were on the previous page also appear on the next page). Maybe check what sort they have, and if it's clicks how many clicks the pet they can't see has (in comparison to the pet they can see). I've figured that the levels and clicks sort both have that problem but the name one doesn't (as usually pets don't have the same name, maybe?)
 
Yeah, it looks like that's probably it. I ran into a similar problem when sorting by level and gender, but not clicks and name. They have their sort set to clicks now, but it could've been set to something else when they reported it.
 
Hmm... I have the issue when it's set to clicks o_O (If more than one pet has the same amount of clicks, they'll sometimes swap places.. get's noticeable when it transfers across pages lol)
 
They replied back and said that there's always a pet missing no matter how they sort their pets.
The pets that vanish changes however you sort the pantry but it always seems to be replaced with a duplicate of the cheese egg for the mouse.
(direct quote)
 
Hmm that's odd o_O I haven't really been able to duplicate it on Foodbabs but I do have like 29 pets now so it's a little hard to really see if one appears more than once or not at all... :/
 
I clicked through the sorting options a bunch of times each and yeah, it seems to randomize which pets appear on what page sometimes which can lead to some pets being missed. I never ran into the problem before when it was always ordered by clicks, but now choosing to order by clicks makes it random o.0
This is just really wierd.
 
It is... it also happens on my site o_O (But I have 30 pets being shown per page, so it probably won't be too much of an issue at the beginning lol)

I don't know how you'd make it not random, unless you specified what order each adoptable owned by that person specifically appeared in... (which would probably be so much work and not very practical in the long run)
 

Similar threads

Users who are viewing this thread

  • Forum Contains New Posts
  • Forum Contains No New Posts

Forum statistics

Threads
4,277
Messages
33,122
Members
1,602
Latest member
BerrieMilk
BETA

Latest Threads

Latest Posts

Top