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

Pages based on sheets with HQL Select-Statements need to be saved with administration-rights

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Invalid
    • Affects Version/s: 3.4
    • Fix Version/s: None
    • Component/s: Velocity
    • Labels:
    • Environment:
      xwiki hosted on linux with tomcat 6.
      Browsers: Firefox, IE
    • keywords:
      velocity, sheets, hql, sql, rights
    • Difficulty:
      Unknown
    • Documentation:
      N/A
    • Documentation in Release Notes:
      N/A
    • Similar issues:

      Description

      We got some strange behaviour when creating new pages based on a sheet that contains velocity-scripts with some hql-queries. New pages based on the sheet can be created by every user and nearly everything works fine, just the results of the select-statements doesn't show up. Seems that an empty resultset is returned. When storing the newly created page with admin-rights everything (including the queries) works fine.

      Parts of the code with the query:

      #set($sql = "select doc.fullName, doc.name from XWikiDocument as doc where (doc.hidden <> true or doc.hidden is null) and doc.space='${doc.space}' and doc.content like '%$doc.name%' order by doc.name asc")
      #set($results=$xwiki.search($sql))
      #if ($results.size() > 0)

      ... -> is empty when the page based on this sheet is saved without admin-rights

        Attachments

          Activity

            People

            Assignee:
            tmortagne Thomas Mortagne
            Reporter:
            hurz Matthias Wegerhoff
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Date of First Response: