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

l10n.js - Reload when logging in as new user #13518

Merged
merged 1 commit into from
Feb 1, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion CRM/Core/Resources.php
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,11 @@ public function addCoreResources($region = 'html-header') {

$tsLocale = CRM_Core_I18n::getLocale();
// Dynamic localization script
$this->addScriptUrl(CRM_Utils_System::url('civicrm/ajax/l10n-js/' . $tsLocale, array('r' => $this->getCacheCode())), $jsWeight++, $region);
$args = [
'r' => $this->getCacheCode(),
'cid' => CRM_Core_Session::getLoggedInContactID(),
];
$this->addScriptUrl(CRM_Utils_System::url('civicrm/ajax/l10n-js/' . $tsLocale, $args, FALSE, NULL, FALSE), $jsWeight++, $region);
Copy link
Contributor

Choose a reason for hiding this comment

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

@colemanw is there anything that is needed here to trigger the re-loading if the cid doesn't match or does it do that automatically?

Copy link
Member Author

Choose a reason for hiding this comment

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

The changed value of the cid url param breaks browser caching so it reloads automatically.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think the point is the url will be different & hence not treated the same?

Copy link
Contributor

Choose a reason for hiding this comment

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

yep happy with that just wanted to double check the logic good to merge from me 👍


// Add global settings
$settings = array(
Expand Down