Uploaded image for project: 'Olio'
  1. Olio
  2. OLIO-98

Check of params (POST request parameter hash) for new image and document uploads fails when no image or document is uploaded

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.1
    • 0.2
    • rails-app
    • None
    • Rails 2.3.2

    Description

      In Rails 2.3.2, when a blank parameter is sent in a request, the params[:parameter] is now set to nil instead of the empty string "". When a new user or event is created without an image or document, the corresponding checks evaluate to true, resulting in the processing on a new image or document. An exception is then thrown from this processing and is caught by the controller resulting in failure.

      Patch is as follows (made on 0.1:
      Index: users_controller.rb
      ===================================================================
      — users_controller.rb (revision 776860)
      +++ users_controller.rb (working copy)
      @@ -223,7 +223,7 @@
      private ###################################################

      def new_image?

      • return (params[:user_image] == '') ? false : true
        + return !(params[:user_image].blank?)
        end

      def invites_for_friend_links(user)
      Index: events_controller.rb
      ===================================================================
      — events_controller.rb (revision 776860)
      +++ events_controller.rb (working copy)
      @@ -327,11 +327,11 @@
      end

      def new_image?

      • return (params[:event_image] == '') ? false : true
        + return !(params[:event_image].blank?)
        end

      def new_document?

      • return (params[:event_document] == '') ? false : true
        + return !(params[:event_document].blank?)
        end

      def attendee_list(event, max)

      Attachments

        Activity

          People

            shanti Shanti Subramanyam
            hubertwong Hubert Wong
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: