TypeError: n.indexOf is not a function[Learn More] commentstabview.js:612:8
Steps to reproduce
- have a user with a numeric username. in my case, I created a user with (username = 2 and display name = numericUsername)
- Go to a file or folder -> Detail --> Comments
- In commant, yype this: @numericUsername (it is to quote the user in the text) and send.
Actual behaviour
the comment does not pass (see the image in attachment)
No problem if it is a user with a username with string.

Server configuration
Operating system: Version Apache 2.4.41 Version de PHP 7.3.12 Version de MySQL 10.3.21-MariaDB Architecture x86_64 OS linux
Database: Type: mysql Version: 10.3.21 Size: 2.5 MB
PHP version: Version: 7.3.12 Memory Limit: 512 MB Max Execution Time: 3600 Upload max size: 64 MB
Nextcloud version: (see Nextcloud admin page) Version: 16.0.7.1 Apps installed: 50 Apps updates available: 0
Updated from an older Nextcloud/ownCloud or fresh install:
Where did you install Nextcloud from: from scratch
cc @nickvergessen
Hello, Is there a workaround for this bug? I tried to debug the source commentstabview.js. but it does not exist locally! How I can debug this source to suggest a solution? Thank you in advance for your assistance :)
after debugging.
here is what I found as a solution:
replace :
-1!==n.indexOf(" ")?e.html('@"'+n+'"'):e.html("@"+n)
by
-1!==n.toString().indexOf(" ")?e.html('@"'+n+'"'):e.html("@"+n)
in ../apps/comments/js/comments.js
Is this Issue still valid? If not, please close this issue. Thanks! :)
This is not yet resolved! I proposed a solution but is not yet included in the sources!
Thanks for the feedback @rassakali! Would you be able to create a PR with your fix? That would be great! :)
After verifications, this problem is not reproducible in version 21.x.