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

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.3
    • Fix Version/s: 4.1-milestone-1, 4.0.1
    • Component/s: Old Core
    • Labels:
      None
    • Difficulty:
      Unknown
    • Documentation:
      N/A
    • Documentation in Release Notes:
      N/A
    • Similar issues:

      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

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

              Dates

              • Created:
                Updated:
                Resolved:
                Date of First Response: