bartervg / barter.vg

Track and hold discussion on Barter.vg bugs, enhancements, and other issues
https://barter.vg
MIT License
20 stars 4 forks source link

Relationship type "full game" can refer to beta or demo #165

Closed bartervg closed 3 years ago

bartervg commented 3 years ago

Describe the bug

When setting a link to the full game, there is a corresponding link created and it is always "demo." There needs to be a way to set full game and have the other link be beta.

Steps to reproduce the bug

  1. When creating new item for a beta, set full game relationship
  2. Go to the linked item
  3. Discover that the relationship is "demo" when it should be "beta"

Expected behavior

Full game (beta) Full game (demo)

Additional context

Mentioned on Discord https://discord.com/channels/329829406153375755/329829406153375755/741345982494539906

Luckz commented 3 years ago

I assume the workaround is creating links the other way around?

bartervg commented 3 years ago

I assume the workaround is creating links the other way around?

Yes, this works if ones is adding related links on the profile pages, but if one is using the giveaway add item form, that isn't a practical workaround.

I added full game (beta) and full game (demo) to the Add Item form. These new types don't exist in the database, so there's a few hacky lines to catch these types before inserting to the database.

if($type == 'full game (beta)'){
    $type = 'full game';
    $corresponding_type = 'beta';       
}
elseif($type == 'full game (demo)'){
    $type = 'full game';
    $corresponding_type = 'demo';                       
}   

image

bartervg commented 3 years ago

Although full game (beta) was an option on the pulldown, it was not possible to set the related type as such because the old logic would change the corresponding type of full game to demo.

Now, if the corresponding type is set, it won't be changed. In addition, there was variable name confusion in the feed activity that used the item type (Game) instead of the related type (full game). This should be correct now.