@@ -111,7 +111,7 @@ public function form($auth_token = NULL, $order_id = NULL) {
111111 $ this ->form_validation ->set_rules ('vendor_shipping ' , 'the orders shipping ' , 'callback_check_numeric_rating ' );
112112 $ this ->form_validation ->set_rules ('vendor_comments_source ' , 'Comments Source ' , 'callback_check_comments_source ' );
113113 if ($ this ->input ->post ('vendor_comments_source ' ) == 'prepared ' )
114- $ this ->form_validation ->set_rules ('vendor_prepared_comments ' , 'Vendor Comments ' , 'callback_check_vendor_prepared_comments ' );
114+ $ this ->form_validation ->set_rules ('vendor_prepared_comments ' , 'Vendor Comments ' , 'callback_check_vendor_prepared_comments ' );
115115 // If user wishes to type in their own data?
116116 if ($ this ->input ->post ('vendor_comments_source ' ) == 'input ' )
117117 $ this ->form_validation ->set_rules ('vendor_free_comments ' , 'Vendor Comments ' , 'max_length[150]|htmlentities ' );
@@ -145,6 +145,8 @@ public function form($auth_token = NULL, $order_id = NULL) {
145145 }
146146 }
147147
148+ $ full_item_post = $ this ->input ->post ("item " );
149+
148150 // If the review is the long format:
149151 if ($ this ->input ->post ('review_length ' ) == 'long ' ) {
150152 $ c = 0 ;
@@ -154,13 +156,14 @@ public function form($auth_token = NULL, $order_id = NULL) {
154156 $ this ->form_validation ->set_rules ("item[ {$ c }][quality] " , "item " .($ c +1 )."'s quality " , 'callback_check_numeric_rating ' );
155157 $ this ->form_validation ->set_rules ("item[ {$ c }][matches_desc] " , "item " .($ c +1 )."'s matches description " , 'callback_check_numeric_rating ' );
156158 $ this ->form_validation ->set_rules ("item[ {$ c }][comments_source] " , "item " .($ c +1 )."'s comments source " , "callback_check_comments_source " );
157- $ item_post = $ this ->input ->post ("item[ {$ c }] " );
159+
160+ $ item_post = $ full_item_post [$ c ];
158161 // Comments source will determine what rule to apply
159162 if (isset ($ item_post ['comments_source ' ])) {
160- if ($ item_post ['comments_source ' ] == 'prepared ' )
161- $ this ->form_validation ->set_rules ("item[ {$ c }][prepared_comments] " , "item " .($ c +1 )."'s comments " , "callback_check_prepared_comments " );
162- if ($ item_post ['comments_source ' ] == 'input ' )
163+ if ($ item_post ['comments_source ' ] == 'input ' )
163164 $ this ->form_validation ->set_rules ("item[ {$ c }][free_comments] " , "item " .($ c +1 )."'s comments " ,"max_length[150]|htmlentities " );
165+ if ($ item_post ['comments_source ' ] == 'prepared ' )
166+ $ this ->form_validation ->set_rules ("item[ {$ c }][prepared_comments] " , "item " .($ c +1 )."'s comments " , "callback_check_item_prepared_comments " );
164167 }
165168
166169 if ($ this ->form_validation ->run () == TRUE ) {
@@ -173,7 +176,7 @@ public function form($auth_token = NULL, $order_id = NULL) {
173176 }
174177 }
175178 }
176-
179+
177180 // If the generated rules are adhered to, we can proceed to store the reviews.
178181 if ($ this ->form_validation ->run () == TRUE ) {
179182 if ($ this ->review_model ->publish_reviews ($ all_reviews , 'buyer ' ) == TRUE ) {
0 commit comments