Uploaded image for project: 'Jetspeed 2 (Retired)'
  1. Jetspeed 2 (Retired)
  2. JS2-530

MenuElementImpl.getMetadata does not return the defined data

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0-FINAL
    • 2.1
    • PSML
    • None

    Description

      Following PSML given in folder.metadata:

      <?xml version="1.0" encoding="iso-8859-1"?>
      <folder>
      <title>Assistant</title>
      <metadata name="title" xml:lang="de">Assistant</metadata>

      <metadata name="priority">20</metadata>

      </folder>

      When I know try to get the metadata when rendering the navigation in a MenuElementImpl object representing this folder, you always get null returned.

      Following code causes the bug in MenuElementImpl:
      public GenericMetadata getMetadata()
      {
      // return node metadata
      if (node != null)
      {
      GenericMetadata metadata = node.getMetadata();
      if ((metadata != null) && ((metadata.getFields() == null) || metadata.getFields().isEmpty()))

      { return metadata; }

      }
      return null;
      }

      The inner if statement returns false, if elements are in the collection. But that is not good, becaus so you get null returned, if there are fields in the colleciton.

      The inner if statement should be something like:
      if ((metadata != null) && (metadata.getFields() != null) && !metadata.getFields().isEmpty()))

      Best Regards
      Robert Schmelzerr

      Attachments

        Activity

          People

            ate Ate Douma
            roschmel Robert Schmelzer
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: