OrchardCMS / Orchard

Orchard is a free, open source, community-focused Content Management System built on the ASP.NET MVC platform.
https://orchardproject.net
BSD 3-Clause "New" or "Revised" License
2.37k stars 1.12k forks source link

Avoid SingleTermId being null if at least one term is checked #8662

Closed AndreaPiovanelli closed 1 year ago

AndreaPiovanelli commented 1 year ago

In reference to #8661 If no term with the proper culture is found, SingleTermId is the id of the first valid checked term. This patch avoids TaxonomyViewModel.SingleTermId to be null when at least one term has been checked by the user. This was a bug happening when TaxonomyField was configured to allow the selection of a single term only.

AndreaPiovanelli commented 1 year ago

@sebastienros I forgot to apply the last update to Orchard's dev-derived branch, which now is pushed. I simplified the subsequent query following your suggestions too.