Uploaded image for project: '{RETIRED} XWiki Contrib'
  1. {RETIRED} XWiki Contrib
  2. XCONTRIB-274

Error "Failed to execute the [velocity] macro" is displayed if a totem element is deleted

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • None
    • None
    • None
    • None

    Description

      Error "Failed to execute the [velocity] macro" is displayed in somme Totem :

      Caused by: org.apache.velocity.exception.MethodInvocationException: Invocation of method 'resolveAttachment' in class org.xwiki.model.script.ModelScriptService threw exception java.lang.IllegalArgumentException: The resolver parameter doesn't contain an Entity Reference of type [ATTACHMENT] at xwiki:Totem.ddddddddddd[line 22, column 32]
      at org.apache.velocity.runtime.parser.node.ASTMethod.handleInvocationException(ASTMethod.java:243)
      at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:187)
      at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:280)
      at org.apache.velocity.runtime.parser.node.ASTReference.value(ASTReference.java:567)

      To reproduce :

      • create a Totem
      • Add a section
      • choose élément in the section
      • delete the element used in this section from element administration

      To solve : A missing element in the totem MUST NOT break the page in view or edit mode.

      • When we display the totem: If an element does not exist anymore, skip it and try to display the next one. If there is no next one we go back. If we can't go back because there was only 1 entry or only missing entry, we can display an error OR it's better if we do not display the totem at all.
      • When openning the totem in edit mode: Display the reference to the missing element and add the notion ("do not exist anymore, will be removed"). Then clean the list on save.
        Idea for later which do not fit in the budget for this project:
      • When deleting an element of the carousel we might say that this element is used by a carousel
      • When openning the carousel in edit mode, warn the user that the entry "XXXX" need to be cleaned or recreated in using the same type of display than what we're doing with class objects.

      Attachments

        Activity

          People

            Unassigned Unassigned
            sidali Djebloun Sidali
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: