Multiple fixes:
- Caching of overrides was using inconsistent tag in Shortcut assets. - Fix JavaScript race condition in dashlet prefs form code.
This commit is contained in:
parent
3922cf7238
commit
58449bb158
3 changed files with 15 additions and 7 deletions
|
|
@ -33,6 +33,8 @@
|
|||
- API change: in ProfileField, the get*Fields family of methods are now class methods
|
||||
- API change: 'func' and 'op' are now reserved and not usable as profile fields
|
||||
- fix: project editing in project management systems not reading fields correctly
|
||||
- fix: JavaScript race condition in dashlet prefs form
|
||||
- fix: caching problem with overrides in dashlets
|
||||
|
||||
7.0.6
|
||||
- fix: Error in DateTime.pm
|
||||
|
|
|
|||
|
|
@ -374,13 +374,18 @@ sub getOverridesList {
|
|||
return $output;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub _overridesCacheTag {
|
||||
my $self = shift;
|
||||
#cache by userId, assetId of this shortcut, and whether adminMode is on or not.
|
||||
return ["shortcutOverrides", $self->getId, $self->session->user->userId, $self->session->var->get("adminOn")];
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub getOverrides {
|
||||
my $self = shift;
|
||||
my $i = 0;
|
||||
#cache by userId, assetId of this shortcut, and whether adminMode is on or not.
|
||||
my $cache = WebGUI::Cache->new($self->session,["shortcutOverrides",$self->getId,$self->session->user->userId,$self->session->var->get("adminOn")]);
|
||||
my $cache = WebGUI::Cache->new($self->session,$self->_overridesCacheTag);
|
||||
my $overridesRef = $cache->get;
|
||||
unless ($overridesRef->{cacheNotExpired}) {
|
||||
my %overrides;
|
||||
|
|
@ -412,7 +417,7 @@ sub getOverrides {
|
|||
my $fieldName = $field->getId;
|
||||
my $fieldValue = $u->profileField($field->getId);
|
||||
$overrides{userPrefs}{$fieldName}{value} = $fieldValue;
|
||||
$overrides{overrides}{$fieldName}{parsedValue} = $fieldValue;
|
||||
$overrides{userPrefs}{$fieldName}{parsedValue} = $fieldValue;
|
||||
# 'myTemplateId is ##userPref:myTemplateId##', for example.
|
||||
foreach my $overr (keys %{$overrides{overrides}}) {
|
||||
$overrides{overrides}{$overr}{parsedValue} =~ s/\#\#userPref\:${fieldName}\#\#/$fieldValue/gm;
|
||||
|
|
@ -626,13 +631,14 @@ sub processPropertiesFromFormPost {
|
|||
$self->SUPER::processPropertiesFromFormPost;
|
||||
my $scratchId = "Shortcut_" . $self->getId;
|
||||
$self->session->scratch->delete($scratchId);
|
||||
$self->uncacheOverrides;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
sub uncacheOverrides {
|
||||
my $self = shift;
|
||||
WebGUI::Cache->new($self->session,["shortcutOverrides",$self->getId])->delete;
|
||||
WebGUI::Cache->new($self->session,$self->_overridesCacheTag)->delete;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -516,11 +516,11 @@ function dashboard_toggleEditForm(event,shortcutId,shortcutUrl) {
|
|||
return;
|
||||
}
|
||||
// Create the new form element.
|
||||
formDiv = document.createElement("div");
|
||||
var formDiv = document.createElement("div");
|
||||
formDiv.id = "form" + shortcutId + "_div";
|
||||
formDiv.className = "userPrefsForm";
|
||||
parentDiv = document.getElementById("td" + shortcutId + "_div");
|
||||
contentDiv = document.getElementById("ct" + shortcutId + "_div");
|
||||
var parentDiv = document.getElementById("td" + shortcutId + "_div");
|
||||
var contentDiv = document.getElementById("ct" + shortcutId + "_div");
|
||||
parentDiv.insertBefore(formDiv,contentDiv);
|
||||
var hooha = AjaxRequest.get(
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue