Uploaded image for project: 'Runtime'
  1. Runtime
  2. RUNTIME-3899

Multiple attribute: Default value on unexisting value

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 4.8.0, 4.7.6
    • 4.7.2
    • None
    • None
    • 4.8.0 M5

      Steps to reproduce

      • Create a content type with a multiple content attribute
      • Add a default value to this attribute like pointing to an unexisting content:
        <default-value type="attribute" name="code">WRONG</default-value>
      • Try to create or edit a content with this content type
      • You get an error message with no link with the real error. It is an NPE at line 237 of org.ametys.cms.data.type.AbstractContentElementType. It is caused by an array with one null element due to org.ametys.runtime.model.DefaultElementDefinition.getDefaultValue()

      If the attribute is multiple, we create an array of number of theorical default values.
      But our value is null here, so we get an array with a null element.

      NB : This case can occur while using other data than the client data or if an element have been deleted.

            cbayle Caroline Bayle
            bmaurel Bérénice Maurel
            Caroline Bayle Caroline Bayle
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: