The Passenger door hasn't locked for a while since the car was laid up

Recently I decided to investigate

I found that the lock does operate when the door is open

It will lock and stay locked with the door open

It will also unlock

When the door is closed it doesn't operate at all

When drivers door is open it will lock then automatically unlock

So when the Passenger door is open it behaves as if it's closed

When it's closed it doesn't do anything at all

Any idea what is going on?