mtierltd / timetracker

GNU Affero General Public License v3.0
83 stars 29 forks source link

[bug] Assigned users are lost when editing a project #121

Closed AlexandersWebdesign closed 3 years ago

AlexandersWebdesign commented 3 years ago

When editing a project, the assignment to the employees is always deleted and must be reset each time.

tigrrr commented 3 years ago

Just confirming this bug makes the thing very unusable..

mtierltd commented 3 years ago

I have not been able to reproduce this issue so please provide more information regarding your nextcloud release, database backend and a list of steps to reproduce. Thank you

kralan commented 3 years ago

I can provoke the issue by executing the following steps:

  1. Create a new project, name it "test"
  2. Check that the project "test" exists and has the currently logged in user in the column "allowed users"
  3. Click into the row diplaying the new project "test" to edit it
  4. In the edit dialog, change the name to "test1" and click "Edit project"
  5. Observe that the project is renamed to "test1" but has an empty column "allowed users"

I don't see any possibility to edit the values of "allowed users" or "allowed tags".

mtierltd commented 3 years ago

Hi

I've taken the steps you described and still could not reproduce the issue. What database backend are you using?

tigrrr commented 3 years ago

Hi, I can confirm the issue via the same steps that kralan described above. The problem is that if i change any of the project properties, the field allowed.users is cleared. It would make sense to add allowed.users as an editable field. The backen specs are: PHP 7.4.3, Database pgsql:PostgreSQL 12.7 (Ubuntu 12.7-0ubuntu0.20.04.1) on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0, 64-bit. Nextcloud version: 22.0.0 (stable).

kralan commented 3 years ago

My database backend is mariadb 10.5.10, php7.4-mysql 7.4.21, nextcloud 22 on a debian bullseye system, arm64

mtierltd commented 3 years ago

Are you on the latest version of timetracker?

tigrrr commented 3 years ago

I was on 0.0.62, have updated to 0.0.64 and the issue hasn't changed after the update..

On Sun, Jul 25, 2021 at 6:07 PM mtierltd @.***> wrote:

Are you on the latest version of timetracker?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/mtierltd/timetracker/issues/121#issuecomment-886223452, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGZRP6GV4KMZ6O53SXLAO63TZQZFZANCNFSM472X5U6A .

kralan commented 3 years ago

I am at 0.0.64 right now, the problem has been present at least since 0.0.59, but I can't tell when it started for me, I don't edit my projects that often.

kralan commented 3 years ago

By inspecting the code I found out that there is a possibility of editing the allowed users and tags. Ticking the "locked" checkbox to edit is not exactly intuitive. But I still cannot edit the allowed users - clicking in the respective field says "The results could not be loaded". Could this be related to the lost users problem?

image

mtierltd commented 3 years ago

Could you please upload your nextcloud logfile from the time when the results could not be loaded message appears?

kralan commented 3 years ago

This is all I could get, I had to set the log level to 0=debug to obtain any messages at all. It is an excerpt of the minute I tried to set the allowed users. The command to obtain the log was journalctl --identifier=Nextcloud --grep=timetracker.

nextcloud_timetracker.log

Eothred commented 3 years ago

Hi,

Also confirming this issue. There seem to be some inconsistency in locking the project. They are by default set to "not locked", and with the user who created the project (me) as "allowed users" as others have commented earlier. When I edit the project the allowed user is cleared, project remains unlocked but this functionality does not seem to work accurately. It behaves as if locked (accessible no one).

A work-around is to lock the project when you edit it and select your user. Here I cannot reproduce kralan's issue of not seeing the users. I see all Nextcloud users. After locking/selecting my user it works as expected again.

I am on Nextcloud 22.1.0, Time Tracker 0.0.69.

kralan commented 3 years ago

I noticed that in projects.js, all uri constructions are wrapped in OC.generateUrl(), with one exception being the generation of the request for the list of users. This could explain why it does not work for me (I have nextcloud in a directory under webroot, behind a reverse proxy) but works for others who have nextcloud installed in root locally.

kralan commented 3 years ago

I split out the problem with obtaining a list of users into a separate issue #144.

kralan commented 3 years ago

I don't see how this issue is resolved. The part of the problem split out as #144 is solved. Still, the original problem persists:

Please reopen this issue.