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

Importing a rule from a file doesn't save the rule. #230

Closed
bugfolder opened this issue Apr 27, 2024 · 1 comment · Fixed by #231
Closed

Importing a rule from a file doesn't save the rule. #230

bugfolder opened this issue Apr 27, 2024 · 1 comment · Fixed by #231

Comments

@bugfolder
Copy link
Collaborator

If you try importing a rule from a file via admin/config/workflow/rules/reaction/import_file, although the process completes with no errors, the status message says the rule was imported, and watchdog log reports that it was imported, it was never saved to the db and therefore doesn't exist.

However, importing the rule by pasting its data in via admin/config/workflow/rules/reaction/import works just fine.

This appears to be because the function rules_ui_import_file_form_submit() is missing the call to $rules_config->save() that is present in function rules_ui_import_form_submit(). And indeed, copying the same code over fixes the problem.

A test rule for importing (to verify the issue) is attached.

PR to follow.
rules_test_rule.json

@argiepiano
Copy link
Collaborator

Thanks, @bugfolder. LGTM. Incidentally, the file upload widget should be required. Otherwise you get a fatal error when submitting without having selected a file. I'll open a new issue.

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

Successfully merging a pull request may close this issue.

2 participants