collectiveaccess/providence — pull request #10 by svendecabooter (2012-09-26 10:43:27+00:00)
Title: Bundle default cataloguing locale selection doesn't work for single-language installations

As per PROV-417 the ca.genericbundle.js file was altered to select the default cataloguing language in a locale selection dropdown, rather than the default English.

However there was still some code missing to make this also work for single-locale installations. With the current code, attributes get saved in the database without a locale_id set.
Given that the installation is single-language anyway, this isn't a huge issue.

However, the problems arise when you enable an extra cataloguing locale on an install which previously only had one. The attributes that were saved earlier still have no locale_id, causing all sorts of problems.

This is easily fixed by adding some extra logic, as provided by this pull request.

I have tested this code on both a single-locale installation & multi-locale installation, and both work fine and as expected.