Door lock problem

I have a 2003 Nissan Pickup Frontier with manual locks, not automatic.

When I got it last year, the key would unlock the door only some of the time, so I got out of the habit of locking it.

I learned recently if you put in the key and turn it towards the locking position, and then turn it to the unlocking position, it will unlock. For a few months, it would always unlock this way, but now, it catches partway open, and it needs a second or third turn to the lock then the unlock position to get it to open.

Once, while unlocking it from the inside, the plastic thing that locks and unlocks the door from the inside that sits by the the door opening lever broke. Now it moves freely without doing anything.

The new problem is, now, every time I shut the door, it locks automatically. With the inside lever not operating, the passenger cant get out from the inside since the door is always automatically locking.

We took off the door panel and nothing obvious looks wrong.

Does anyone have a suggestion about the cause of the automatic door locking and what to do about it?? Thanks

I had a similar problem with my wife’s 2000 Altima. You could only lock it from the inside-the electric lock didn’t work at all. I was ready to change out switches, solenoids etc, and it turned out to be two phillips head screws thet fasten the solenoid rod to the lock rod were loose. 20 minute fix!