You are viewing a plain text version of this content. The canonical link for it is here.
Posted to olio-dev@incubator.apache.org by "Hubert Wong (JIRA)" <ji...@apache.org> on 2009/05/20 23:56:45 UTC

[jira] Created: (OLIO-98) Check of params (POST request parameter hash) for new image and document uploads fails when no image or document is uploaded

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

                 Key: OLIO-98
                 URL: https://issues.apache.org/jira/browse/OLIO-98
             Project: Olio
          Issue Type: Bug
          Components: rails-app
    Affects Versions: 0.1
         Environment: Rails 2.3.2
            Reporter: Hubert Wong
            Assignee: Shanti Subramanyam


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)


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (OLIO-98) Check of params (POST request parameter hash) for new image and document uploads fails when no image or document is uploaded

Posted by "Shanti Subramanyam (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OLIO-98?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Shanti Subramanyam resolved OLIO-98.
------------------------------------

       Resolution: Fixed
    Fix Version/s: 0.2

Fixed and tested.

> Check of params (POST request parameter hash) for new image and document uploads fails when no image or document is uploaded
> ----------------------------------------------------------------------------------------------------------------------------
>
>                 Key: OLIO-98
>                 URL: https://issues.apache.org/jira/browse/OLIO-98
>             Project: Olio
>          Issue Type: Bug
>          Components: rails-app
>    Affects Versions: 0.1
>         Environment: Rails 2.3.2
>            Reporter: Hubert Wong
>            Assignee: Shanti Subramanyam
>             Fix For: 0.2
>
>
> 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)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (OLIO-98) Check of params (POST request parameter hash) for new image and document uploads fails when no image or document is uploaded

Posted by "Shanti Subramanyam (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OLIO-98?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Shanti Subramanyam closed OLIO-98.
----------------------------------


> Check of params (POST request parameter hash) for new image and document uploads fails when no image or document is uploaded
> ----------------------------------------------------------------------------------------------------------------------------
>
>                 Key: OLIO-98
>                 URL: https://issues.apache.org/jira/browse/OLIO-98
>             Project: Olio
>          Issue Type: Bug
>          Components: rails-app
>    Affects Versions: 0.1
>         Environment: Rails 2.3.2
>            Reporter: Hubert Wong
>            Assignee: Shanti Subramanyam
>             Fix For: 0.2
>
>
> 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)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.