Giter VIP home page Giter VIP logo

Comments (17)

simpleauthority avatar simpleauthority commented on July 17, 2024 1

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.

from xenfororesourcemanagerapi.

simpleauthority avatar simpleauthority commented on July 17, 2024 1

I just regained access to an XF installation, so I'll be debugging this soon.

from xenfororesourcemanagerapi.

MiniDigger avatar MiniDigger commented on July 17, 2024

they all don't have identities, maybe thats it?

from xenfororesourcemanagerapi.

InventivetalentDev avatar InventivetalentDev commented on July 17, 2024

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.

"SELECT u.user_id, u.username, u.resource_count, u.avatar_date, u.gravatar, GROUP_CONCAT(uf.field_id SEPARATOR '\n') AS identity_key, GROUP_CONCAT(ufv.field_value SEPARATOR '\n') AS identity_val
FROM xf_user u
INNER JOIN xf_user_field_value ufv
ON ufv.user_id = u.user_id
INNER JOIN xf_user_field uf
ON ufv.field_id = uf.field_id
WHERE uf.display_group = 'contact' AND ufv.user_id = :user_id
GROUP BY u.user_id"

from xenfororesourcemanagerapi.

InventivetalentDev avatar InventivetalentDev commented on July 17, 2024

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

from xenfororesourcemanagerapi.

frostalf avatar frostalf commented on July 17, 2024

if matters, while that api action returns 404, if you use action=getResourcesByAuthor&id=45870 it shows their resources.

from xenfororesourcemanagerapi.

simpleauthority avatar simpleauthority commented on July 17, 2024

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?

from xenfororesourcemanagerapi.

md-5 avatar md-5 commented on July 17, 2024

@simpleauthority yeah I just picked a random user (45870) and xf_user_field_value is indeed empty for them

from xenfororesourcemanagerapi.

InventivetalentDev avatar InventivetalentDev commented on July 17, 2024

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.

from xenfororesourcemanagerapi.

simpleauthority avatar simpleauthority commented on July 17, 2024

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.

from xenfororesourcemanagerapi.

md-5 avatar md-5 commented on July 17, 2024

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

from xenfororesourcemanagerapi.

simpleauthority avatar simpleauthority commented on July 17, 2024

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.

from xenfororesourcemanagerapi.

md-5 avatar md-5 commented on July 17, 2024

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

from xenfororesourcemanagerapi.

simpleauthority avatar simpleauthority commented on July 17, 2024

I gotcha. I'll try it soon.

from xenfororesourcemanagerapi.

Olzie-12 avatar Olzie-12 commented on July 17, 2024

This is weird, any updates on the solution?

from xenfororesourcemanagerapi.

Olzie-12 avatar Olzie-12 commented on July 17, 2024

I just regained access to an XF installation, so I'll be debugging this soon.

Alright sounds good

from xenfororesourcemanagerapi.

simpleauthority avatar simpleauthority commented on July 17, 2024

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.

from xenfororesourcemanagerapi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.