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

Ensure the ClassifAI Registration settings can be saved properly #853

Merged
merged 1 commit into from
Feb 14, 2025

Conversation

dkotter
Copy link
Collaborator

@dkotter dkotter commented Feb 13, 2025

Description of the Change

In setting up a new environment, I was getting an error when trying to save the ClassifAI Registration settings. In looking at the code, the problem is we grab the existing settings and merge those in to the saved settings. But if no settings exist yet, we end up trying to merge a string into an array, which throws a PHP error.

This PR fixes that by ensuring the default for our settings is an array.

How to test the Change

  1. Set up a new environment or in an existing environment, delete the classifai_settings option
  2. If not on this branch, try saving the ClassifAI Registration settings and see you'll get an error
  3. Check out this branch and try again, settings should now save

Changelog Entry

Fixed - Ensure the ClassifAI Registration settings save correctly

Credits

Props @dkotter

Checklist:

@dkotter dkotter added this to the 3.3.0 milestone Feb 13, 2025
@dkotter dkotter self-assigned this Feb 13, 2025
@dkotter dkotter requested review from jeffpaul and a team as code owners February 13, 2025 20:05
@dkotter dkotter requested review from iamdharmesh and removed request for a team and jeffpaul February 13, 2025 20:05
@github-actions github-actions bot added the needs:code-review This requires code review. label Feb 13, 2025
Copy link
Member

@iamdharmesh iamdharmesh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀

@iamdharmesh iamdharmesh merged commit 426f3f1 into develop Feb 14, 2025
19 checks passed
@iamdharmesh iamdharmesh deleted the fix/registration-saving branch February 14, 2025 06:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs:code-review This requires code review.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants