Problem/Motivation

On a taxonomy term reference field, the Other option is currently available to all users. It should only be available to those who are able to access to the vocab.

Proposed resolution

Check if the current user has createAccess first and only show the Other option if they do.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

nyanmar created an issue. See original summary.

nyanmar’s picture

Title: "Other" option on taxonomy terms should only be available to users with permission » "Other" option on taxonomy term field should only be available to users with permission
StatusFileSize
new4.44 KB
nyanmar’s picture

Status: Active » Needs review

Status: Needs review » Needs work

The last submitted patch, 2: select_or_other-permissions_access-3207231-1.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

beatrizrodrigues made their first commit to this issue’s fork.

beatrizrodrigues’s picture

StatusFileSize
new4.4 KB

I did the reroll of the previous patch.

daften’s picture

Hi,

For a patch like this, we'd definitely need updated tests, can this be included in the patch please?

matheusmaciel’s picture

Component: Field widget (non-specific or listed) » Code
Assigned: Unassigned » matheusmaciel

I'll try to work on it, and maybe I can update the tests as well.

matheusmaciel’s picture

Assigned: matheusmaciel » Unassigned
WagnerMelo’s picture

Assigned: Unassigned » WagnerMelo

Hi, I'll try work in this issue.

WagnerMelo’s picture

Assigned: WagnerMelo » Unassigned
andregp’s picture

Status: Needs work » Needs review
StatusFileSize
new9.64 KB
new12.38 KB

We needed to reroll the patch first to then update the tests. We also improved a bit the comments and CS of the code being added to the issue. The tests passed locally, I hope it will pass on the bot too.

Please also credit @WagnerMelo as he worked with me on this patch.

aldairsoares’s picture

Assigned: Unassigned » aldairsoares

I'm going to review it.

aldairsoares’s picture

Assigned: aldairsoares » Unassigned
Status: Needs review » Reviewed & tested by the community

I have made some tests with two different permissions and everything looks ok.

I'm going to change this issue to RTBC.

andregp’s picture

Assigned: Unassigned » andregp
Status: Reviewed & tested by the community » Needs work

I'm sorry. I didn't notice based the patch on the wrong branch. I'll do a reroll for 8.x-1

andregp’s picture

Assigned: andregp » Unassigned
Status: Needs work » Needs review
StatusFileSize
new9.64 KB
new8.88 KB

The reroll I did to create #12 was not necessary, I wasn't able to apply patch #6 because I was working on the wrong branch (4.x). So I rerolled patch #12 for 8.x-1.x and made a diff between this patch and patch #6.

andregp’s picture

StatusFileSize
new516 bytes

So, looking better to this issue and the module I believe that:
1. The test fails on patch #16 are not related to the patch itself, but the branch 8.x-1 tests are outdated. I'm sending a test patch with a single comment change. If it fails than my hypothesis is right.
2. This issue should be aimed to the 4.x branch as it is actually the most current patch and is probably the right one. If that's the case, then my patch #12 might be enough for the issue and we can probably move it back to RTBC as it was already reviewed by @aldairsoares. I'll wait the tests results to see what can be done here.

andregp’s picture

Version: 8.x-1.x-dev » 4.x-dev
Status: Needs review » Reviewed & tested by the community

Okay, the test fails at #17 show that the banch 8.1-x is old and out of date, so I'm changing the issue branch to 4.x. I believe it can be moved again to RTBC as the patch #12 was already reviewed.

  • hmendes committed 03a5198 on 4.x authored by andregp
    Issue #3207231 by andregp, beatrizrodrigues, nyanmar, WagnerMelo,...
hmendes’s picture

Thanks for the work :D

hmendes’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.