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

Duplicate game entry produces more duplicate entries #114

Open
Clidus opened this Issue Jul 23, 2017 · 0 comments

Comments

Projects
None yet
1 participant
@Clidus
Copy link
Owner

Clidus commented Jul 23, 2017

There is a flaw in this logic:
https://github.com/Clidus/gwl/blob/master/ignition_application/models/game.php#L40

        // check if game is in database
        if($this->isGameInDB($GBID))
        {
            // get game from database
            if($this->getGameFromDatabase($GBID, $userID))
                // game found
                return true;
        }

isGameInDB returns true if more than zero records exist in the database. getGameFromDatabase fails if it doesn't find one record. A duplicate entry in the database will cause isGameInDB to be true, but getGameFromDatabase to fail, causing the code to fall through and add another entry to the database.

Fix this by erroring out if getGameFromDatabase fails.

@Clidus Clidus added the bug label Jul 23, 2017

@Clidus Clidus self-assigned this Jul 23, 2017

@Clidus Clidus referenced this issue Jul 23, 2017

Merged

Version 0.4.7 #116

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