diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 654ef0a0b..b37e3fe11 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -16,8 +16,6 @@ - fixed: Manage Subscription Codes: No way to Select - fixed: Self registration that does not require passwords, now allows multiple users with empty passwords. This means that users can self register without a password and might cause downstream bugs with other wobjects. - fixed: Calendar now uses the correct method to get the current user's time-zone - - Shortcut ##userPref:## macros now work even if Shortcut is not - under a Dashboard - fixed backwards compatibility with new form control API additions: getValue is now an alias to getValueFromForm instead of vice-versa. getValue is still the preferred method, getValueFromForm is still the deprecated method. diff --git a/lib/WebGUI/Asset/Shortcut.pm b/lib/WebGUI/Asset/Shortcut.pm index c73aa889a..839eed230 100644 --- a/lib/WebGUI/Asset/Shortcut.pm +++ b/lib/WebGUI/Asset/Shortcut.pm @@ -424,23 +424,22 @@ sub getOverrides { } else { $self->session->errorHandler->warn("Original asset could not be instanciated by shortcut ".$self->getId); } - - # Process shortcut macros - my $u = WebGUI::User->new($self->session, $self->discernUserId); - my @userPrefs = $self->getPrefFieldsToImport; - foreach my $fieldId (@userPrefs) { - my $field = WebGUI::ProfileField->new($self->session,$fieldId); - next unless $field; - my $fieldName = $field->getId; - my $fieldValue = $u->profileField($field->getId); - $overrides{userPrefs}{$fieldName}{value} = $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; - } - } - + if ($self->isDashlet) { + my $u = WebGUI::User->new($self->session, $self->discernUserId); + my @userPrefs = $self->getPrefFieldsToImport; + foreach my $fieldId (@userPrefs) { + my $field = WebGUI::ProfileField->new($self->session,$fieldId); + next unless $field; + my $fieldName = $field->getId; + my $fieldValue = $u->profileField($field->getId); + $overrides{userPrefs}{$fieldName}{value} = $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; + } + } + } $cache->set(\%overrides, 60*60); $overridesRef = \%overrides; }