-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix the bug of traceback error of server on webpage #5402
Conversation
Generated by 🚫 Danger |
app/controllers/tag_controller.rb
Outdated
@@ -300,7 +300,7 @@ def create | |||
body: "@#{current_user.username} awards a #{barnstar_info_link} to #{node.user.name} for their awesome contribution!") | |||
|
|||
elsif tagname.split(':')[0] == "with" | |||
user = User.find_by_username_case_insensitive(tagname.split(':')[1]) | |||
user = User.find_by_username_case_insensitive(current_user.username) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Power-tag with:user1
adds user with username user1
as co-author of the note. So, we want to get their username from tag and so this change is wrong
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh!!! I missed out this. Sorry for the wrong change. I'll commit with correct one soon.
Thanks @gauravano
e6f1feb
to
82511cf
Compare
Hi @gauravano @jywarren I've updated the PR as requested. 😄 |
814e234
to
ee53cbf
Compare
ee53cbf
to
d886aab
Compare
@publiclab/plots2-reviewers |
app/controllers/tag_controller.rb
Outdated
if Tag.exists?(tagname, nid) | ||
@output[:errors] << I18n.t('tag_controller.tag_already_exists') | ||
|
||
elsif tagname.include?(":") && tagname.split(':').length < 2 # cant tag empty power tags |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You mean Can't add empty power tags
😅 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @gauravano
What I mean was we can add with
but not with:
? 😅
Is this not supposed to be like this ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was referring to comment not code 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh!! Forgot about that. I'll fix it.
if Tag.exists?(tagname, nid) | ||
@output[:errors] << I18n.t('tag_controller.tag_already_exists') | ||
|
||
elsif tagname.include?(":") && tagname.split(':').length < 2 # cant tag empty power tags | ||
if tagname.split(':')[0] == "barnstar" || tagname.split(':')[0] == "with" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hey @CleverFool77, I think we can implement this for all power tags, we have many - https://publiclab.org/wiki/power-tags. What do you say?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @gauravano In other power tags, If I'll add some of the other power tags like build:
, alert:
,notes:
etc then neither it shows traceback error nor its gets added, which is correct.
Only with:
and barnstars:
which were implemented in different way were showing traceback error and That's why I added only both of them here.
Thanks !!!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok! I think, we can discuss it after merging this that whether we want to show alert if someone try to use incomplete power tag, even in case where no error is thrown. Thanks!
Great work here! @CleverFool77 💯 👍 |
I think, we are almost done here. Just correct the comment or you can also remove it. Thanks! |
Hi @gauravano |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work!
🎉 💯 👍 |
* fix the bug of traceback error of server on webpage * remove comment
* fix the bug of traceback error of server on webpage * remove comment
Fixes #5378 #5404<=== Add issue number here)
The changes -
with
,then there won't be a traceback error like earlierwith:
orbarnstars:
tag, then it won't show the traceback error rather it would show that the power tag can't be empty.Before changes

After changes

rake test
@publiclab/reviewers
for help, in a comment belowThanks!