[ 
https://issues.apache.org/jira/browse/JSPWIKI-168?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18137559#comment-18137559
 ] 

Arturo Bernal commented on JSPWIKI-168:
---------------------------------------

I looked at what exists today in master for this request.

The first of the two version numbers proposed here is already in the Haddock 
skin: Wiki.js has version: "haddock04" ("js version, used to validate 
compatible preference cookies"), and on domready, if the version stored in the 
JSPWikiUserPrefs cookie differs, it erases the cookie and writes the new 
version. It is a constant in the script that is changed by hand; it is not tied 
to the release of JSPWiki. The second number, one set by the administrator in 
jspwiki.properties to force a reset of the cookies after a change of the 
configuration, does not exist: today it would mean editing the script.

On the server, Preferences.parseJSONPreferences merges whatever the cookie 
holds over the defaults and does not look at that version. While checking this 
I found that a cookie that is not a JSON object made the page lose its 
stylesheets and scripts, so that the script that replaces the cookie never ran. 
That is JSPWIKI-1323, with pull request 
https://github.com/apache/jspwiki/pull/577.

I am leaving this issue open: the number set by the administrator would be a 
design decision, and nobody has asked for it in recent years that I can see. 
JSPWIKI-652 was a clone of this issue made by mistake and closed as invalid.

> Introduction of JSPWiki settings version numbers for being able to update 
> cookies after software or settings have changed
> -------------------------------------------------------------------------------------------------------------------------
>
>                 Key: JSPWIKI-168
>                 URL: https://issues.apache.org/jira/browse/JSPWIKI-168
>             Project: JSPWiki
>          Issue Type: New Feature
>            Reporter: Florian Holeczek
>            Priority: Minor
>
> Initial idea from Dirk Frederickx:
> we could introduce the notion of a 'version' number for user preferences. 
> This prefs-version-nbr should then be stored in the cookie. Upstepping this 
> version number could be used to force a rewrite of all cookies, avoiding 
> incompatibilies between server side settings and cookies.
> This could be useful for things like timeformats, introduction of new skins, 
> introudction of new editors, etc. Also useful when upgrading JSPWiki from 
> v2.4.x to v2.6.x.
> My comment:
> I'd refine this to two version numbers: one internal for JSPWiki version 
> changes (automatically trigger a cookies update) and one in the properties 
> file for the site admin to change and therefore trigger a cookies update 
> manually after configuration changes.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to