Closed InventivetalentDev closed 4 years ago
they all don't have identities, maybe thats it?
Yeah, was thinking the same. Looks like it's doing an inner join on 3 tables, including the one seemingly containing the identity info, so it might just skip everyone without identity info.
https://github.com/SpigotMC/XenforoResourceManagerAPI/blob/284b2888445a46263abcb40668a4804867203e96/support/Database.php#L56-L63
Though, I've also stumbled upon a couple users that are returned by the API which have an empty identities array (instead of an object)
e.g.
https://api.spigotmc.org/simple/0.1/index.php?action=getAuthor&id=68433
https://api.spigotmc.org/simple/0.1/index.php?action=getAuthor&id=68413
if matters, while that api action returns 404, if you use action=getResourcesByAuthor&id=45870 it shows their resources.
I'll do some investigation on this ASAP.
Though, I've also stumbled upon a couple users that are returned by the API which have an empty identities array (instead of an object) e.g.
https://api.spigotmc.org/simple/0.1/index.php?action=getAuthor&id=68433 https://api.spigotmc.org/simple/0.1/index.php?action=getAuthor&id=68413
Good catch on the object vs array. That was unintentional. I'll make that more consistent.
So, on my local install of XenForo every new user has the xf_user_field_value
's automatically generated although they are blank.
I am guessing Spigot's installation is not doing this, for whatever reason.
I am not sure if a different type of join would work better or if I should just do two separate queries for the necessary data.
Comments?
@simpleauthority yeah I just picked a random user (45870) and xf_user_field_value is indeed empty for them
Doing a left instead of an inner join should, in theory, help with this. Instead of not returning the users without identities at all, they should return NULL identities when left-joining.
Well, it's worth a try for sure. I'm not sure I understand why for some users it works but for others it doesn't when xf_user_field_value is always present but empty. The join should work in any case. I can't reproduce locally, so the way we'd have to test would be push to prod and see if it helped which is less than ideal.
Could just wipe em from your test db. I'm not sure why they're not filled in on Spigot; could be xenforo versions or way users are created
Could just wipe em from your test db. I'm not sure why they're not filled in on Spigot; could be xenforo versions or way users are created
That's the thing though. On my test db, I have a user with blank xf_user_field_value
's like you described (none are null) and it works fine. Since they're not null, the inner join should work just fine.
I'm open to trying the left join, but I can't reproduce locally so I would have no way of knowing if the change of join works or not.
I'm open to trying the left join, but I can't reproduce locally so I would have no way of knowing if the change of join works or not.
DELETE FROM xf_user_field_value WHERE user_id=99
Its a test DB, you should just be able to do that and see if it still works
I gotcha. I'll try it soon.
This is weird, any updates on the solution?
I just regained access to an XF installation, so I'll be debugging this soon.
I just regained access to an XF installation, so I'll be debugging this soon.
Alright sounds good
Works fine locally with missing rows in the xf_user_field_value
table -- in my local install, they're never missing, but they are in Spigot. This may be a patch fix from XF that I have which Spigot doesn't...unknown. Regardless, #29 fixes it.
A lot of authors return 404s via the API, even though both their resource overview and profile page exist and are publicly accessible.
Possibly related to #17
A few examples: