Skip to content

Hotfix/blog article validation

Robert Sinton requested to merge hotfix/blog_article_validation into master

Blog articles could not be saved because of a 500 error. POST only — PUT was OK.

Traced to a recent validation-related change in the blog API controller, which seems to be about ensuring that no article fields are the same as the URL title?

This change did not play nicely with the categories field (set of checkboxes) because it supplied an array as its value rather than a string, and the validation library's is_unique() method couldn't cope with that.

As I wasn't sure exactly what the intent was of the validation change, I just did a quick fix by eliminating categories from consideration for that rule. Probably needs further attention.

Merge request reports