Automattic / Automattic/co-authors-plus

Cannot add users in WPML second language on posts

Open
#896 1 comment 0 reactions 0 assignees View on GitHub
priority: low status: needs investigation type: bug
Dominant language
PHP
Stars
322
Forks
216
Avg merge
7h 50m
Merged PRs (30d)
65

Description

Hi guys
First of all great work with the plugin.

We have a problem with adding authors in other languages.
We are using WPML and we have 4 languages.
English is the main language and everything works OK. It has a problem when you want to add authors in other languages.
When you add authors in main language everything works (in post editor you can search for users, select them and then you can save it).
When you make a translation of a post and search for users (Gutenberg) of the same post it doesn't return any results. There are no errors in the console.

When I tried to do a quick edit of the post and do a search I get the error:
"Sorry, no matching authors found."
And there is an error in the console after I click on the dropdown with the error above:
Uncaught TypeError: vals[1] is undefined
coauthors_autosuggest_select https://www.investigate-europe.eu/wp-content/plugins/co-authors-plus/js/co-authors-plus.js?ver=3.5.6:200
There are no errors in the debug.log

Current state:
PHP:7.4.30
WP 6.0.3
Co-Authors plus 3.5.6
WPML 4.5.13

We have tried with old versions of the plugin but with no luck:
3.5.4
3.5.3
I suspect that this could be a conflict with the latest WPML update as the search was working before that (but it didn't always return results).

Any thoughts why it doesn't return any usernames in other languages but English?

Thank you

Contributor guide

Open the contributing guide

Research direction

Start with co-authors-plus.js at line 200, where coauthors_autosuggest_select reports vals[1] as undefined after an author search in quick edit. Reproduce the search on a translated Gutenberg post with WPML, compare it with the English post flow, and confirm that authors can be found and selected without the console error.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, php, wordpress
Domain
backend, frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.