Everyone has access to locked articles

I have a strange problem. I have a journal which is not open access. The site shows the “locked” icon, the price, and the currency. However, if you click on the “lock” icon, it goes directly to the PDF of the article for free!

What is even stranger is that a separate journal on the same system works perfectly fine. I have combed through the settings, and can’t find anything that would cause this.

Here is an example that is messed up:
https://journals.blythinstitute.org/ojs/index.php/cbi/article/view/30

Notice the red “lock” icon with a price. Clicking the icon gives you the article for free!

Here is an example that is working (different journal, same installation):
https://journals.blythinstitute.org/ojs/index.php/edited_volumes/article/view/eandu-5

Clicking on the red “lock” icon here requires a login.

Help! What could be the issue?

Using version 3.1.1.4

After playing around with it a bit, I figured out a way to prevent it, but I’m not sure it is the right one. I changed the line in pages/article/ArticleHandler.inc.php from:

$userId = $user?$user->;getId():0;

to

$userId = $user?$user->;getId():-1;

Apparently, on this particular journal, it thought that user_id 0 had purchased the issue. I’m not sure how that happened. I can’t find which table has purchase records for issues, so it is hard to track down. I did verify that there was no one in the users table with an id of 0.