Automattic / Automattic/babble

Translations failing "You are not allowed to edit posts as this user"

Open
#322 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
PHP
Stars
250
Forks
44
PR merge metrics
No merged PRs in 30d

Description

**Background:** We have a translation team of 'Editor' role who are trying to translate a few 100 posts written by other people. When they try to save the Translation (either In Progress or Complete) it throws the _"You are not allowed to edit posts as this user"_ error.

_Note that this error also happens for users of the 'Administrator' role._

This error only seems to happen when users try and translate other peoples Posts. I can Publish a Post myself and translate it no problem. But I can't translate anyone else's content.

For weeks we've assumed some weird permissions issue is to blame which was related to an unsanctioned WordPress upgrade on the live site but today we discovered that the same issue is on our local development site and staging site. It wan't picked up before because we had not tried Translating other users Posts, only our own that we had added for testing purposes.

**Debug error from the Translations panel:**

_Catchable fatal error: Argument 1 passed to Babble_Jobs::get_post_meta_to_translate() must be an instance of WP_Post, null given, called in /siteremoved/wp-content/plugins/babble/class-jobs.php on line 1070 and defined in /siteremoved/wp-content/plugins/babble/class-jobs.php on line 1207_

Running WP 4.3 and Babble 1.5.1

Contributor guide

Open the contributing guide

Research direction

Start in wp-content/plugins/babble/class-jobs.php around lines 1070 and 1207, then reproduce saving a translation of another user's post as an Editor or Administrator. Compare that path with translating a post owned by the current user and inspect the Translation panel error. Done means translations for other users' posts save without the permission error or fatal argument failure.

Written by the indexing model from the issue text.

Assessment

Tech stack
php, wordpress
Domain
backend, internationalization
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 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.