Lestrade's

Lestrade's Lounge => The Fatal Problem => Topic started by: Zomby on June 3rd, 2017, 05:55 PM

Title: Can only see tradables that aren't in my library
Post by: Zomby on June 3rd, 2017, 05:55 PM
As of today, I can only see tradables that are in my library.

While I'm sure it would be a very nice OPTIONAL feature when looking at someone else's tradables, it's quite useless when looking at mine and actually prevents me from managing my tradables properly. (Now I have to find every single game manually again to delete them after doing a large trade, while I could finally delete them all from the tradable list before this change.)
Title: Re: Can only see tradables that aren't in my library
Post by: [Lestrades.com] Nao 尚 on June 3rd, 2017, 08:05 PM
I'll look into this. Obviously it's unwanted. ;)
Posted: June 3rd, 2017, 07:59 PM

What does the page say exactly..? can you post a screenshot? (including URL)
My code seems to be okay but I'm tired so maybe I'm missing it.

PS: the problem has to be code-related because that's one of the things I worked on today-- adding a 'no library' filter for non-premium users. (The feature had already been available to the few premium testers on the site for weeks now.)
Title: Re: Can only see tradables that aren't in my library
Post by: Zomby on June 3rd, 2017, 08:20 PM
The page says "59 tradables found that aren't in your library:" and only shows my tradables not in my library.

It's right on https://lestrades.com/tradables/(https://lestrades.com/tradables/)

(http://i.imgur.com/oSIHnmu.png?1)


Title: Re: Can only see tradables that aren't in my library
Post by: [Lestrades.com] Nao 尚 on June 3rd, 2017, 09:57 PM
Can you try adding ?lim= to the url? (Nothing after =)
For debugging purposes...
Title: Re: Can only see tradables that aren't in my library
Post by: [Lestrades.com] Nao 尚 on June 4th, 2017, 01:31 AM
Should be fixed now.
That was a nasty bug-- ironically, one bug I already met a few weeks ago.
$_GET['lim'] = ($_GET['lim'] ?? 0);
That's all there was to it... "If lim isn't set, force it to 0".
Then in a later line, I test $_GET['lim'] == 'nolibrary'.
That's all there was to it. A non-set 'lim' is now 0, and 0 == 'nolibrary', because PHP sucks sometimes.
Just adding an extra '=' to the '==' was enough to fix it.
I didn't catch the bug originally because I'm a permanent premium user, so I always get to skip that test. :^^;: