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

setLocale: precaution for when setLocale is called on an unilingual site #13465

Merged
merged 1 commit into from
Jan 15, 2019

Conversation

mlutfy
Copy link
Member

@mlutfy mlutfy commented Jan 15, 2019

Overview

This is a small tweak for a specific use-case:

  • CiviCRM is running in a single language (i.e. not multi-lingual)
  • The site is using an extension that uses CRM_Core_I18n::setLocale(), but not checking if the site is in multi-lingual (ex: cdntaxreceipts).

but it might also cover the use-case where a site uses the multi-gettext language option, but not multi-lingual database (ex: #13240).

Before

Calling setLocale() on a non-multilingual DB would cause subsequent SQL queries to fail, because the dbLocale suffix gets set, but the sql views do not exist.

After

DB queries do not fail.

@civibot
Copy link

civibot bot commented Jan 15, 2019

(Standard links)

@civibot civibot bot added the master label Jan 15, 2019
@seamuslee001
Copy link
Contributor

This looks sane to me adding merge on pass as we have enough multilingual tests to confirm if this is fine or not

@eileenmcnaughton
Copy link
Contributor

@mlutfy is this addressing a potential recent regression? If so it should be against the rc

@mlutfy
Copy link
Member Author

mlutfy commented Jan 15, 2019

@eileenmcnaughton No it's been like that for a while.

@colemanw colemanw merged commit b105d55 into civicrm:master Jan 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants