Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(infobox): return false instead of nil for custom Publisherpremier #4911

Closed
wants to merge 19 commits into from

Conversation

Hesketh2
Copy link
Collaborator

@Hesketh2 Hesketh2 commented Oct 18, 2024

Summary

Several wikis uses a different param for highlighted tiers (e.g. riotpremier valve-sponsored) which means a local implementation

these wikis apparently returns nil if its unset, in #4852 after the TeamCard Storage changes publishertier storage to false which meant now if it returns nil = it causes the highlight to triggered anyway

image

Side Note

There are wikis that still returns nil but the issue does not occured (e.g. Dota2) I will leave those untouched

can I just remove the '1' here? is it for app reasons? (Compared to wildrift for example)
@Hesketh2 Hesketh2 self-assigned this Oct 18, 2024
cc hjp: you may want to double check on this if this is all the fixes I needed to do or not given Warcraft code is a bit different
@Hesketh2
Copy link
Collaborator Author

added all the wikis I could find, please check on the fixes for LoL and Warcraft if possible since they seem different from the rest by the original setup and I'm not sure if theres further fixes needed (the current fix revision already solves the problem)

Some wikis do return nil like Dota2, but the issue isnt popping over there so I didnt touch it

@Hesketh2 Hesketh2 marked this pull request as ready for review October 18, 2024 15:00
Tournaments list shows highlight unintentionally, this seems to be the fix for the case
@Hesketh2 Hesketh2 marked this pull request as draft October 18, 2024 15:37
Copy link
Collaborator

@hjpalpha hjpalpha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

on several wikis you just slap Logic.readBool on it
there we need to check what values are stored there currently
like it could be that some wikis have string inputs there

  • brawlstars
  • cod
  • crossfire
  • fortnite
  • halo
  • naraka
  • pkmn
  • pubg
  • pubgm

i will write you a small module on commons for it
but you will have to do the leg work (previewing stuff per the above listed wikis and reporting on the results)

for warcraft it might be better to use or ''

@hjpalpha
Copy link
Collaborator

hjpalpha commented Oct 18, 2024

preview {{#invoke:CheckPublisherTier|run}} on any page of each of the above listed wikis
if you get a result other than an empty string please report it here (naming the wiki and the output)

@Hesketh2
Copy link
Collaborator Author

Hesketh2 commented Oct 18, 2024

For all wikis (except CS/warcraft) that is recieving fixed in this PR: the module returns no text, so its empty

League of Legends returns: 1 due to the code setup still mentions "1" from the original setup

trying or '' for warcraft runs into the same current issue as counterstrike, Highlight always appears on infobox even if parameter is never exist in the page
image

edit: Counterstrike returns the following
Major Championship; Major Qualifier; Minor Championship; RMR Event; Tier 1; Tier 1 Qualifier; Tier 2; Tier 2 Qualifier; Wildcard

so I would need a fix for the always showing highlight when or '' is used,

@hjpalpha
Copy link
Collaborator

hjpalpha commented Oct 18, 2024

so I would need a fix for the always showing highlight when or '' is used,

you have 3 options:

  • use or '' and overwrite the highlight function in the infobox on those wikis
  • use or nil and overwrite the storage part in the infobox on those wikis
  • use or nil and adjust the commons function for storage to Logic.isNotEmpty(self.data.publishertier) and tostring(self.data.publishertier) or ''

@hjpalpha
Copy link
Collaborator

hjpalpha commented Oct 18, 2024

League of Legends returns: 1 due to the code setup still mentions "1" from the original setup

maybe make sure that no module/template/... conditions on that

@hjpalpha
Copy link
Collaborator

hjpalpha commented Oct 18, 2024

For all wikis (except CS) that is recieving fixed in this PR: the module returns no text, so its empty

warcraft has several values there too fwiw

@Hesketh2
Copy link
Collaborator Author

Hesketh2 commented Oct 18, 2024

so I would need a fix for the always showing highlight when or '' is used,

you have 3 options:

  • use or '' and overwrite the highlight function in the infobox on those wikis
  • use or nil and overwrite the storage part in the infobox on those wikis
  • use or nil and adjust the commons function for storage to Logic.isNotEmpty(self.data.publishertier) and tostring(self.data.publishertier) or ''

for warcraft i'm trying the first options but surely I didnt do it correctly (since WC and CS had a very unique setup that I would be clueless at, so pasting this function is the only way I know) https://liquipedia.net/warcraft/index.php?title=Module%3AInfobox%2FLeague%2FCustom%2Fdev%2Fh2&type=revision&diff=943825&oldid=943818 (This would likely required different approach on CS given CS has even more complicated setup with Valve Tiers)

"1" seems to be existed since 2022 so it looks like a primitive code
@hjpalpha
Copy link
Collaborator

discord discussion:

IMG_5086
IMG_5087
IMG_5088

as seen there imo as a temp solution change commons storage to:
lpdbData.publishertier = tostring(self.data.publishertier or '')
that way you do not harm any wikis
and we win some time to do a proper discussion about what to do with the field

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants