Uploaded image for project: 'admincentral'
  1. admincentral
  2. ADMINCTR-70

Default timezone overwritten with GMT timezone when editing user profile

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Neutral
    • 6.2.20
    • 6.2.19
    • None
    • Nucleus 12
    • 2

    Description

      When editing a user without an explicitly configured timezone (defaults to server timezone), this one is overridden with GMT timezone when saving the user profile dialog.

       

      Workarounds:

      A. Use the old dialog (revert this change)

      B. or remove empty timezone properties from users via a script scripts.removeEmptyUserTimezones.xml / update task.

      import info.magnolia.context.MgnlContext
      import info.magnolia.jcr.util.PropertyUtil
      
      import javax.jcr.Node
      import javax.jcr.Property
      import javax.jcr.query.Query
      
      session = MgnlContext.getJCRSession("users")
      session.getWorkspace().getQueryManager()
              .createQuery("SELECT * FROM [mgnl:user] AS user WHERE ISDESCENDANTNODE('/admin') AND user.timezone IS NOT NULL", Query.JCR_SQL2)
              .execute()
              .nodes
              .forEachRemaining((Node node) -> {
                  Property property = PropertyUtil.getPropertyOrNull(node, "timezone")
                  if (property != null) {
                      println "Removing " + property
                      property.remove()
                  }
              })
      //session.save() //uncomment this when satisfied with list of properties to remove
      
      

       

      Checklists

        Acceptance criteria

        Attachments

          Issue Links

            Activity

              People

                asiska Adam Siska
                jayala Jonathan Ayala
                Nucleus
                Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:

                  Time Tracking

                    Estimated:
                    Original Estimate - Not Specified
                    Not Specified
                    Remaining:
                    Remaining Estimate - Not Specified
                    Not Specified
                    Logged:
                    Time Spent - 3.5h
                    3.5h