Fix the Post handling Metadata possibleValues differently from other Assets.
This commit is contained in:
parent
a75e83b52d
commit
7901e1d398
4 changed files with 42 additions and 24 deletions
|
|
@ -1,5 +1,6 @@
|
|||
7.7.13
|
||||
- fixed #10574: Creating Calendar Entry
|
||||
- fixed #10522: Metadata value & label problem
|
||||
|
||||
7.7.12
|
||||
- Updated auth to allow sending back of non-text/html mime types.
|
||||
|
|
|
|||
|
|
@ -13,6 +13,12 @@ save you many hours of grief.
|
|||
* Due to changes in the userSession database table, you must upgrade
|
||||
to 7.7.13 before upgrading to 7.7.14 or beyond.
|
||||
|
||||
* WebGUI has allowed metadata possible values to be processed differently
|
||||
by Posts than from other Assets. This causes problems when metadata is
|
||||
shared between Posts and other Assets. To rememdy this, all metadata
|
||||
possible values are being moved into the standard "pipe format", and
|
||||
the Post will no longer process data in the other format.
|
||||
|
||||
7.7.8
|
||||
--------------------------------------------------------------------
|
||||
* A basic behavior of the Inbox has been changed. If a message is
|
||||
|
|
@ -125,7 +131,9 @@ save you many hours of grief.
|
|||
Tags field. Extra Head Tags are now added for all templates and
|
||||
assets included on a page, except for Style templates, which do
|
||||
not have Extra Head Tags. Existing Extra Head Tags for Style
|
||||
templates have been removed.
|
||||
templates will be lost. If your current Style template uses
|
||||
the Head Block please put any content from there directly into your
|
||||
style template inside the <head></head> tags.
|
||||
|
||||
* Web Services Client is no longer part of the official distribution of
|
||||
WebGUI, but is still available to be maintained by third-parties. However,
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@ my $session = start(); # this line required
|
|||
|
||||
# upgrade functions go here
|
||||
addSessionTokenId($session);
|
||||
correctPostMetaData($session);
|
||||
|
||||
finish($session); # this line required
|
||||
|
||||
|
|
@ -46,7 +47,6 @@ finish($session); # this line required
|
|||
#}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
# Describe what our function does
|
||||
sub addSessionTokenId {
|
||||
my $session = shift;
|
||||
print "\tAdding CSRF token to userSession, if needed... " unless $quiet;
|
||||
|
|
@ -58,6 +58,28 @@ sub addSessionTokenId {
|
|||
print "DONE!\n" unless $quiet;
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
sub correctPostMetaData {
|
||||
my $session = shift;
|
||||
my $root = WebGUI::Asset->getRoot($session);
|
||||
print "\tPutting metadata associated with posts into the standard metadata possibleValues format... " unless $quiet;
|
||||
# and here's our code
|
||||
my $meta = $root->getMetaDataFields();
|
||||
FIELD: foreach my $field (keys %{ $meta }) {
|
||||
next FIELD unless $meta->{$field}->{possibleValues} && $meta->{$field}->{possibleValues} =~ m/\}/;
|
||||
my $values = WebGUI::Operation::Shared::secureEval($session, $meta->{$field}->{possibleValues});
|
||||
next FIELD unless ref $values eq 'HASH';
|
||||
my $newValues = '';
|
||||
while (my ($key, $value) = each %{ $values }) {
|
||||
$newValues .= join '|', $key, $value;
|
||||
$newValues .= "\n";
|
||||
}
|
||||
print "\n\t\tUpdating ".$meta->{$field}->{fieldName};
|
||||
$root->addMetaDataField(@{ $meta->{$field} }{ qw/fieldId fieldName defaultValue description fieldType/ }, $newValues);
|
||||
}
|
||||
print "DONE!\n" unless $quiet;
|
||||
}
|
||||
|
||||
|
||||
# -------------- DO NOT EDIT BELOW THIS LINE --------------------------------
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue