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

Getting the value of the 'wiki' XWiki meta tag does not work anymore

    XMLWordPrintable

Details

    • Unknown

    Description

      On javascript.vm, we have:

          ## --------------------------------
          ## Store the space name, page name, wiki name, full document name (for convenience since it can be reconstructed
          ## from the individual wiki/space/page names), and other metadata, so that it can be accessed from Javascript code.
          ## For example, to pass it to the server side using an Ajax query.
          ## Usage example: var name = $$("meta[name='page']")[0].content;
          ##
          ## --------------------------------
          <meta name="document" content="$escapetool.xml($doc.fullName)"/>
          <meta name="wiki" content="$escapetool.xml($doc.wiki)"/>
          <meta name="space" content="$escapetool.xml($doc.space)"/>
          <meta name="page" content="$escapetool.xml($doc.name)"/>
          <meta name="version" content="$doc.version"/>
          <meta name="restURL" content="${request.contextPath}/rest/wikis/${xcontext.database}/spaces/$escapetool.url(${doc.space})/pages/$escapetool.url(${doc.name})"/>
          <meta name="form_token" content="$!{services.csrf.token}"/>
      

      But when I write a script using:

      $$("meta[name='wiki']")[0].content
      

      It does not work.

      Actually

      $$("meta[name='wiki']")
      

      returns an empty array.

      Meanwhile

      $$("meta[name='page']")
      

      returns an array with the desired element.

      I guess it breaks some extensions that uses these meta-tags.

      Attachments

        Activity

          People

            gdelhumeau Guillaume Delhumeau
            gdelhumeau Guillaume Delhumeau
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: