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

Don't explode if beatmapset is deleted #2032

Merged
merged 2 commits into from Dec 21, 2017

Conversation

3 participants
@notbakaneko
Contributor

notbakaneko commented Dec 19, 2017

Quick fix for exploding user pages
https://osu.ppy.sh/users/6969988

@@ -292,7 +292,7 @@ public function vote($params)
public function title()
{
if ($this->beatmap_id === null) {
return $this->beatmapset->title;
return $this->beatmapset ? $this->beatmapset->title : '[deleted beatmap]';

This comment has been minimized.

@nanaya

nanaya Dec 19, 2017

Collaborator

🤔

// beatmap-specific discussion
if ($this->beatmap !== null) {
    return "{$this->beatmapset->title} [{$this->beatmap->version}]";
}

// generalAll discussion
if ($this->beatmap_id === null && $this->beatmapset !== null) {
    return $this->beatmapset->title;
}

return '[deleted beatmap]';
@nanaya

nanaya Dec 19, 2017

Collaborator

🤔

// beatmap-specific discussion
if ($this->beatmap !== null) {
    return "{$this->beatmapset->title} [{$this->beatmap->version}]";
}

// generalAll discussion
if ($this->beatmap_id === null && $this->beatmapset !== null) {
    return $this->beatmapset->title;
}

return '[deleted beatmap]';

This comment has been minimized.

@nanaya

nanaya Dec 19, 2017

Collaborator

or a bit more detailed with something like

if beatmap_id == null
  if beatmapset == null
    [deleted beatmap]
  else
    beatmapset
else
  if beatmap == null
    beatmapset [deleted difficulty]
  else
    beatmapset [beatmap]
@nanaya

nanaya Dec 19, 2017

Collaborator

or a bit more detailed with something like

if beatmap_id == null
  if beatmapset == null
    [deleted beatmap]
  else
    beatmapset
else
  if beatmap == null
    beatmapset [deleted difficulty]
  else
    beatmapset [beatmap]
@nanaya

nanaya approved these changes Dec 21, 2017

@nanaya nanaya merged commit 14b1549 into ppy:master Dec 21, 2017

2 checks passed

continuous-integration/styleci/pr The StyleCI analysis has passed
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@notbakaneko notbakaneko deleted the notbakaneko:fix/user-discussion-history-deleted-beatmapset branch Dec 21, 2017

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