nilsteampassnet / TeamPass

Collaborative Passwords Manager
https://www.teampass.net
1.63k stars 532 forks source link

Undefined array key "allowed_to_read" in index.php?page=api #4190

Open guyomog78 opened 1 month ago

guyomog78 commented 1 month ago

Hi,

After an upgrade from 2 to 3 (3.1.2.44) and some other issues, I found an error on the api configuration page for API key List tab and Users tab image

image

I have take a look on the database and discover that the allowed_to_read column didn't exist.

So, after a search in your code here => https://github.com/nilsteampassnet/TeamPass/blob/f851d99b522d71434648d5ba0361b3305c49d7c4/install/upgrade_run_3.1.php#L35

In the table api, you renamed the column read_only by allowed_to_read, but you didn't manage the case where read_only don't exist.

After a quick check, this column is not present in version 2, and I didn't find any creation in the upgrade path (only find in the install.queries.php).

I have manually created the column and now it's OK

Best Regards

Guillaume