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

$xwiki.getDocument / get('email') doesn't work for field with email type

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Fix
    • Major
    • None
    • 6.3
    • None
    • Unknown
    • N/A
    • N/A

    Description

      Hello,
      I applied/adapted this snippet http://extensions.xwiki.org/xwiki/bin/view/Extension/CSV+Export+of+Users to export users of the wiki in CSV format but it doesn't work for field with email type (no values are return)

      Here my code to paste for testing:

      {{velocity}}
      #if("$!{request.confirm}" == '1')
       #set($ok = $response.setContentType("text/csv"))
       #set($ok = $response.setHeader("Content-disposition", "attachment; filename=export-users.csv"))
      login;firstname;lasname;email;MonMail;MonMailString;phone
       #set ($sql = ", BaseObject as obj where obj.name = doc.fullName and obj.className = 'XWiki.XWikiUsers' and obj.name <> 'XWiki.XWikiUserTemplate' order by doc.name asc")
       #foreach($user in $xwiki.searchDocuments($sql))
         #set($userDoc = $xwiki.getDocument($user))
      "$userDoc.name";"$userDoc.get('first_name')";"$userDoc.get('last_name')";"$userDoc.get('email')";"$userDoc.get('MonMail')";"$userDoc.get('MonMailString')";"$userDoc.get('phone')"
       #end
      #else
       * [[Download CSV list of users>>||queryString="confirm=1&xpage=plain&outputSyntax=plain"]]
      #end
      {{/velocity}}
      

      I did more test: remove "Validation Regular Expression" without success.
      I add 2 another XWiki.XWikiUsers properties:

      • "MonMail (MonMail: Email)" it doesn't work either
      • and MonMailString (MonMailString: String) this working well

      By the way, if I fill "Custom Display" off "Last Name (last_name: String)" no values are return either (perhaps I must open another issue for this one?)

      Thxs

      Pascal B

      Attachments

        Activity

          People

            tmortagne Thomas Mortagne
            Pbas Pascal BASTIEN
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: