Extending ReferenceManyField with new type cause dupes choices to appear
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 3.9k
- Forks
- 703
- PR merge metrics
- No merged PRs in 30d
Description
Hi!
I managed to extend `ReferenceManyField` like this :
```
import ReferenceManyField from 'admin-config/lib/Field/ReferenceManyField';
class ReferenceManyCustomField extends ReferenceManyField {
constructor(name) {
super(name);
this._type = 'reference_many_custom';
}
}
export default ReferenceManyCustomField;
```
But now the `choices` displayed include the current field value.
If I remove the line where I change the `_type` property, it goes back to normal.
Any hints on why this is happening?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in admin-config/lib/Field/ReferenceManyField and compare the behavior with and without changing _type to reference_many_custom. Reproduce the custom subclass case and verify that the choices no longer include the current field value when the type is extended.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- angularjs, javascript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100