# Bug AUTOWORK-345 - User can make a field mandatory and deactivate it on the same form

Project: Stream Workflows & Automations
Status: tested
URL: https://community.openproject.org/work_packages/AUTOWORK-345

## Open points

_No work packages_

## Details

| Attribute | Value |
| --- | --- |
| Date |  |
| Priority | High |
| Module | Administration / Type/Variants and Workflows |
| Target versions | 18.0.0 |
| Observed in versions | 18.0.0 |
| Sprint |  |
| Backlog bucket |  |
| Bug found in version (deprecated) | unreleased/dev |
| Requires doc change | No |
| Accessibility | No |
| Pull preview |  |
| List |  |
| Labels |  |

## People

| Attribute | Value |
| --- | --- |
| Assignee |  |
| Accountable |  |
| Product manager |  |
| Developers | David Friquet |
| Designer |  |
| Ordered by |  |
| Signed off by |  |
| Interest by |  |

## Planning

| Attribute | Value |
| --- | --- |
| Relevance |  |

## Costs

| Attribute | Value |
| --- | --- |
| Votes |  |
| Effort (shirt size) |  |
| Work |  |
| Labor costs |  |

## Description

### Steps to reproduce

1.  Login as admin

2.  Go to any WP form

3.  Go to a non-required field and click on 'Require for this type'

4.  Toggle off the field 

### What is the buggy behaviour?

  - User can do this nonsensical action

  - After saving, the field is neither required nor hidden

### What is the expected behaviour?

  - Disable the toggle switch if a custom field is required or required for the type.
    
      - Please note that the UX of this line will change as part of another bug such that the 'Do not require for this type' button and the word 'Hidden' do not appear: <mention class="mention" data-id="82248" data-type="work_package" data-text="##AUTOWORK-351" data-display-id="AUTOWORK-351">\#\#AUTOWORK-351</mention>

### 

### Screenshots and other files

<img class="op-uc-image op-uc-image_inline" src="/api/v3/attachments/926172/content">

### Environment information

**OpenProject version**

Core build

[c522ee14bb465b6fd79f7bb1a6e4cc2285791e0d](https://qa.openproject-edge.com/external_redirect?url=https%3A%2F%2Fgithub.com%2Fopf%2Fopenproject%2Fcommit%2Fc522ee14bb465b6fd79f7bb1a6e4cc2285791e0d)

Product version

[370d7f8956ceb3f4eb9a1dd7592210b436a92e12](https://qa.openproject-edge.com/external_redirect?url=https%3A%2F%2Fgithub.com%2Fopf%2Fsaas-openproject%2Fcommit%2F370d7f8956ceb3f4eb9a1dd7592210b436a92e12)

Core version

OpenProject 18.0.0

**Browser**

- [ ] Chrome
- [x] Firefox
- [ ] Safari
- [ ] Mobile Safari
- [ ] Other (please specify)

**Operating System**

- [x] Windows
- [ ] Mac OS X
- [ ] Mobile iOS
- [ ] Mobile Android
- [ ] Linux (please specify distro)
- [ ] Chrome OS
- [ ] Other (please specify)
