Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge branch 'Release02x01'
  • Loading branch information
gac410 committed Dec 20, 2016
2 parents c5d298f + d046d50 commit 3de6f7a
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 23 deletions.
24 changes: 23 additions & 1 deletion core/data/System/ReleaseNotes02x01.txt
@@ -1,4 +1,4 @@
%META:TOPICINFO{author="ProjectContributor" date="1481823857" format="1.1" version="1"}%
%META:TOPICINFO{author="ProjectContributor" date="1482207308" format="1.1" version="1"}%
%META:TOPICPARENT{name="ReleaseHistory"}%
---+!! Foswiki Release 2.1.1

Expand Down Expand Up @@ -82,6 +82,27 @@ See [[%BUGS%/Item13696][Item13696]] for up-to-date details.

---++ Important changes in Foswiki 2.1.3

---+++ Possible data loss in DataForms

A possible data loss issue was discovered in DataForms migrated from Foswiki 1.x. A new configuration setting (={LegacyFormfieldNames}=) was added to restore the old Foswiki 1.x behavior.

If your site uses DataForms that use non-Ascii field names, the form data will require manual migration, or you must enable ={LegacyFormfieldNames}= in
the configuration.
* Releases prior to Foswiki 2.0 stripped characters other than A-Z, a-z, 0-9 and _. So a field named =Fühler= would be stored as =Fhler=.
* The same DataForms definition on Foswiki 2.0 would be stored as =Fühler=.
With the mismatch of field name, the form field will be lost when the topic is saved.

If you do not enable ={LegacyFormfieldNames}=, then you will need to find and update the =META:FIELD= definitions in the topics. This would need to be done external to Foswiki.
<pre>
%<nop>META:FIELD{name="Fhler" title="F&uuml;hler" value="123"}%
</pre>
would need to be changed to
<pre>
%<nop>META:FIELD{name="F&uuml;hler" title="F&uuml;hler" value="123"}%
</pre>

See [[%BUGS%/Item14256][Item14256]] for more details.

---+++ User Registration

The stored format of pending registrations has been changed to perl "Storable" in order to better support Unicode user names and other registration fields.
Expand Down Expand Up @@ -376,6 +397,7 @@ Foswiki thanks the Translators for their efforts. If you are interesting in hel
| [[%BUGS%/Item14249][Item14249]] | Foswiki::Net uses userinfo functions not available in older versions of LWP. |
| [[%BUGS%/Item14250][Item14250]] | Wait for images by default in jquery.masonry. |
| [[%BUGS%/Item14251][Item14251]] | Remove non-functional caching of dialogs loaded via ajax. |
| [[%BUGS%/Item14256][Item14256]] | Data loss of certain formfield names when moving content from 1.x to 2.x. |

---+++ Enhancements

Expand Down
18 changes: 17 additions & 1 deletion core/data/System/UpgradeGuide.txt
@@ -1,4 +1,4 @@
%META:TOPICINFO{author="ProjectContributor" comment="" date="1478799688" format="1.1" version="1"}%
%META:TOPICINFO{author="ProjectContributor" comment="" date="1482207308" format="1.1" version="1"}%
%META:TOPICPARENT{name="AdminDocumentationCategory"}%
%STARTINCLUDE%
---+ Foswiki Upgrade Guide
Expand Down Expand Up @@ -365,6 +365,22 @@ The following two options are also available, but are not yet recommended.

When =convertTopicSettings= saves the modified topics, they will be saved by user _UnknownUser_.

---+++ DataForms Applications

If your site uses DataForms that used non-Ascii field names, the form data will require manual migration, or you must enable ={LegacyFormfieldNames}= in
the configuration.
* Releases prior to Foswiki 2.0 stripped characters other than A-Z, a-z, 0-9 and _. So a field named =F&uuml;hler= would be stored as =Fhler=.
* The same DataForms definition on Foswiki 2.0 would be stored as =F&uuml;hler=.

If you do not enable ={LegacyFormfieldNames}=, then you will need to find and update the =META:FIELD= definitions in the topics. This would need to be done external to Foswiki.
<pre>
%<nop>META:FIELD{name="Fhler" title="F&uuml;hler" value="123"}%
</pre>
would need to be changed to
<pre>
%<nop>META:FIELD{name="F&uuml;hler" title="F&uuml;hler" value="123"}%
</pre>

---+++ Apply preferences from old installation

If you have not already set your desired site-wide preferences, as described in the section " [[%SYSTEMWEB%.InstallationGuidePart2#Set_Foswiki_Site_Preferences][Set Foswiki Preferences]]" in the %SYSTEMWEB%.InstallationGuide, then set your preferences. The location of your site preferences is specified in the =Miscellaneous settings= pane of the =configure= page, in the ={LocalSitePreferences}= setting (visible when Expert mode is enabled) &mdash; the default location is *%USERSWEB%.<nop>Site<nop>Preferences*. Copy any customized preferences from the site preferences topic in your old installation to the site preferences topic in the new installation. (Note you may have already copied over your customized preferences when you transfered the contents of the &lt;old_users_web&gt; web.)
Expand Down
7 changes: 2 additions & 5 deletions core/data/System/VarQUERY.txt
@@ -1,4 +1,4 @@
%META:TOPICINFO{author="ProjectContributor" date="1437230349" format="1.1" version="1"}%
%META:TOPICINFO{author="ProjectContributor" date="1482207453" format="1.1" version="1"}%
%META:TOPICPARENT{name="Macros"}%
---+ QUERY -- get the value of meta-data
Uses the query syntax described in [[%SYSTEMWEB%.QuerySearch][QuerySearch]] to get information about meta-data from one specified topic.
Expand Down Expand Up @@ -32,10 +32,7 @@ See !QuerySearch for more details of how to write queries

Get configuration setting {NameFilter}:
%<nop>QUERY{"{NameFilter}"}%

List all the installed DataForm field types {FormTypes}:
%<nop>QUERY{"{FormTypes}[].types"}%
</pre>
</pre>
Plain strings (such as field values) are returned _without_ quotes. Simple arrays of scalars are also returned without quotes, in a comma-separated list (beware of values that contain commas!).

More complex data structures (e.g. arrays of hashes) will only be returned if =style="perl"= or =style="json"= are set - else will return a string containing 'undef'.
Expand Down
33 changes: 17 additions & 16 deletions core/lib/Foswiki/UI/Preview.pm
Expand Up @@ -141,22 +141,6 @@ sub preview {
# note: preventing linkage in rendered form can only happen in templates
# see formtables.tmpl

$tmpl = $topicObject->expandMacros($tmpl);
$tmpl = $topicObject->renderTML($tmpl);
$tmpl =~ s/%TEXT%/$displayText/g;

# write the hidden form fields
$tmpl =~ s/%FORMFIELDS%/$formFields/g;

# SMELL: this should be done using CGI::hidden
$text = Foswiki::entityEncode( $text, "\n" );

$tmpl =~ s/%HIDDENTEXT%/$text/g;

$tmpl =~ s/<\/?(nop|noautolink)\/?>//gis;

# I don't know _where_ these should be done,
# so I'll do them as late as possible
my $originalrev = $query->param('originalrev'); # rev edit started on
#ASSERT($originalrev ne '%ORIGINALREV%') if DEBUG;
$tmpl =~ s/%ORIGINALREV%/$originalrev/g if ( defined($originalrev) );
Expand All @@ -172,6 +156,23 @@ sub preview {

#ASSERT($newtopic ne '%NEWTOPIC%') if DEBUG;
$tmpl =~ s/%NEWTOPIC%/$newtopic/g if ( defined($newtopic) );

# CAUTION: Once expandMacros executes, any template tokens that are expanded
# inside a %ENCODE will be corrupted. So do token substitution before this point.
$tmpl = $topicObject->expandMacros($tmpl);
$tmpl = $topicObject->renderTML($tmpl);
$tmpl =~ s/%TEXT%/$displayText/g;

# write the hidden form fields
$tmpl =~ s/%FORMFIELDS%/$formFields/g;

# SMELL: this should be done using CGI::hidden
$text = Foswiki::entityEncode( $text, "\n" );

$tmpl =~ s/%HIDDENTEXT%/$text/g;

$tmpl =~ s/<\/?(nop|noautolink)\/?>//gis;

###
$session->writeCompletePage($tmpl);
}
Expand Down

0 comments on commit 3de6f7a

Please sign in to comment.