alphanodes / additional_tags

Redmine Plugin for adding tags functionality to issues and wiki pages.
https://www.redmine.org/plugins/additional_tags
GNU General Public License v2.0
64 stars 26 forks source link

Fix removal of tags in issue bulk edit action #34

Closed dmakurin closed 2 years ago

dmakurin commented 2 years ago

Removing of tags on the issue bulk edit page currently is broken.

If all selected issues have common tag(s), bulk edit form should display it and allow to remove as it implemented in editing of single issue.

Initially when opening issue bulk edit page it does not render any tags at all. It is possible to add tags in that way but not remove.

PR extracts some logic from the https://github.com/ixti/redmine_tags allowing to remove tags using the issues bulk edit action.

alexandermeindl commented 2 years ago

Hi @dmakurin, thanks again for this work!

ClaudiaMeindl commented 2 years ago

Dear @dmakurin thanks for your PR, but due to these adjustments, it is currently no longer possible to merge tags in the admin area. The TAG to be merged will be deleted without the entity linked to it being transferred to the other one. See attached image in case it's not clear.

Since we currently don't have the time to work on this it would be good if you could find a solution for this problem. Otherwise we would have to make a revert of this PR. Thank you very much.

merge-defect

dmakurin commented 2 years ago

Hello, @ClaudiaMeindl. I'll look into it.

dmakurin commented 2 years ago

@ClaudiaMeindl, sadly but I can't reproduce the bug in my environment.

Environment:
  Redmine version                5.0.3.stable
  Ruby version                   2.7.6-p219 (2022-04-12) [x86_64-linux]
  Rails version                  6.1.7
  Environment                    development
  Database adapter               SQLite
  Mailer queue                   ActiveJob::QueueAdapters::AsyncAdapter
  Mailer delivery                smtp
Redmine settings:
  Redmine theme                  Default
SCM:
  Git                            2.34.1
  Filesystem                     
Redmine plugins:
  additional_tags                1.0.7
  additionals                    3.0.8-main

As far as I understand this is a test case https://github.com/AlphaNodes/additional_tags/blob/e7ff125e99cf4c5141141854342d9e2b9169fcaf/test/functional/additional_tags_controller_test.rb#L86 which passed in all github actions and my setup.

Can you provide more information about your environment and how to reproduce it?

ClaudiaMeindl commented 2 years ago

Hi @dmakurin thanks for getting back to me. This is the environment info:

Environment:
  Redmine version                5.0.3.stable
  Ruby version                   3.1.2-p20 (2022-04-12) [x86_64-linux]
  Rails version                  6.1.7
  Environment                    development
  Database adapter               PostgreSQL
  Mailer queue                   ActiveJob::QueueAdapters::AsyncAdapter
  Mailer delivery                smtp
Redmine settings:
  Redmine theme                  Default
SCM:
  Subversion                     1.14.1
  Mercurial                      5.6.1
  Cvs                            1.12.13
  Bazaar                         3.1.0
  Git                            2.34.1
  Filesystem                     
Redmine plugins:
  additional_tags                1.0.7
  additionals                    3.0.8-main

For reproduction take a look at the gif-video from my prior message. I just merged 2 tags, both with 1 entity. But the merge did not happen. No error message occured. The result was just the same, as if I simply deleted a tag, which I did not (as you can see in the prior gif video).

Thanks for taking the time to check on this.

dmakurin commented 2 years ago

Here is what I did using same ruby and PostgreSQL versions:

Environment:
  Redmine version                5.0.3.stable
  Ruby version                   3.1.2-p20 (2022-04-12) [x86_64-linux]
  Rails version                  6.1.7
  Environment                    development
  Database adapter               PostgreSQL
  Mailer queue                   ActiveJob::QueueAdapters::AsyncAdapter
  Mailer delivery                smtp
Redmine settings:
  Redmine theme                  Default
SCM:
  Git                            2.34.1
  Filesystem                     
Redmine plugins:
  additional_tags                1.0.7
  additionals                    3.0.8-main
  1. Create a new database and load fixtures: bundle exec rails db:reset db:fixtures:load RAILS_ENV=development
  2. Go to Issue#1 and add tag bug#1
  3. Go to Issue#2 and add tag feature#2
  4. Go to Admin - Tags - Manage tags
  5. Select both tags, RMB - Merge
  6. Just submit a pop up form
  7. Both tags were successfully merged
  8. Go to Issue#2 to confirm it

And a gif demonstrating the whole process Peek 2022-11-25 14-21

Am I doing something wrong?

I also tried to run a mentioned above test, it passed successfully: bundle exec rails db:reset test RAILS_ENV=test TEST=plugins/additional_tags/test/functional/additional_tags_controller_test.rb:86

ClaudiaMeindl commented 2 years ago

Hi @dmakurin Thanks for the feedback. The way you proceeded is the way I did it too, but I can't reproduce the error anymore either. It occurred 2x (the second time I had made the video). I had suspected that it is related to the character set used (Chinese / Korean). I have now tested various languages with special characters. If it doesn't occur with you and no error message appears and I can't reproduce it anymore, then it seems probably to work. Thanks for checking back.