Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DKAN2 Drupal Multiselect Autocomplete Issue with Topics in Dataset Form #3995

Open
DaniyalRaza786 opened this issue Aug 1, 2023 · 4 comments

Comments

@DaniyalRaza786
Copy link

Hi, I am using DKAN2 Drupal. I am facing a problem with adding datasets in the dataset form. I have two multiselect autocomplete fields, one is for tags, and the other is for topics (themes). I want to stop the "allowCreate" option for topics. However, when we set "allowCreate" to false in the JSON schema in the dataset.ui file, it's not working as expected. On the other hand, when we remove the "allowCreate" attribute from the schema, it partially works as it doesn't allow adding or selecting any new topics that do not exist in the provided list. But, in this scenario, when we submit any datasets with selected topics, the selected topics are not saved. And when we edit the same datasets again, it shows empty topic fields.

@DaniyalRaza786 DaniyalRaza786 changed the title I want to stop allowcreate for topic (theme) DKAN2 Drupal Multiselect Autocomplete Issue with Topics in Dataset Form Aug 1, 2023
@janette
Copy link
Member

janette commented Aug 4, 2023

@DaniyalRaza786 you will have to make the topics a regular select field until more options are built in.

@DaniyalRaza786
Copy link
Author

@janette we need multiselect

@stefan-korn
Copy link
Contributor

@DaniyalRaza786 : I came across this problem too. I have created a module to fix this issue (and another regarding references, see #4298 ): DKAN reference fix

Installing this module and setting the allowCreate value to "false" should make the dataset form work like you expected it.

Your feedback is appreciated.

Background info: the module is changing the tag option of select2 based on the value of allowCreate, while still keeping the autocreate option true (this is needed for DKAN to work correctly, otherwise the inputs get lost as you described).

@dafeder
Copy link
Member

dafeder commented Dec 17, 2024

Will take a closer look at the dkan_reference_fix module and see if some/all of these tweaks can be incorporated into our module.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants