Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-7309

Exception while saving a document due to migration of boolean properties from strings

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 4.1-milestone-1, 4.0.1
    • 3.3
    • Old Core
    • None
    • Unknown
    • N/A
    • N/A

    Description

      This has happen to me in the following circonstances, but there is many other possibilities:

      1) Created a new wiki, importing the latest XE xar
      2) Imported an old WebPreference page (comming from 2.4) into myspace
      3) Edit the some preferences in the Admin application, which cause XWiki.XWikiPreferences to be saved
      4) Get an expception (Exception while saving document mywiki:XWiki.XWikiPreferences Wrapped Exception: For input string: "yes")

      After debugging, we had found two issues:

      1) the migration of broken properties happend on all documents, not the saved one. So while I was saving XWiki.XWikiPreferences, it was breaking on a property of myspace.WebPreferences, which prevent me to save XWiki.XWikiPreferences. This is obviously really bad.

      2) while the "showhistory" preference was previously a String, and is now a boolean, it breaks on fixing it while doing a props.fromString("yes") which in fact cause for a boolean an new Integer("yes"). Since the yes is in the database already, imported previously, the only workaround is to delete the offending document.

      Attachments

        Activity

          People

            sdumitriu Sergiu Dumitriu
            softec Denis Gervalle
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: