Uploaded image for project: 'Turbine'
  1. Turbine
  2. TRB-9

Intake: Handling of empty values

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Fixed
    • Core 2.3.2
    • None
    • Turbine 2.3
    • None

    Description

      It seems to be impossible transmit the empty string as a value: In the HTTP request

      http://.../turbine/...?aaa=123&bbb=&ccc=456

      the parameter bbb is ignored.

      If you look at org.apache.turbine.services.intake.model.Field.init(ValueParser pp) you find:

      if (pp.containsKey(getKey()))
      {
      if (isDebugEnabled)

      { log.debug(name + ": Found our Key in the request, setting Value"); }

      if (StringUtils.isNotEmpty(pp.getString(getKey())))

      { setFlag = true; }

      validate();
      }
      else if (pp.containsKey(getValueIfAbsent()) &&
      pp.getString(getValueIfAbsent()) != null)

      { pp.add(getKey(), pp.getString(getValueIfAbsent())); setFlag = true; validate(); }

      The StringUtils.isNotEmpty() condition (line 342) prevents that a field can take up the empty string as its value.

      Attachments

        1. patch_TRB-9.txt
          3 kB
          Jürgen Hoffmann

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            stefanb Stefan Broetz
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment