Update category and amenity for editing events.
authorSteve Sutton <steve@gaslightmedia.com>
Fri, 4 Nov 2016 16:01:15 +0000 (12:01 -0400)
committerSteve Sutton <steve@gaslightmedia.com>
Fri, 4 Nov 2016 16:01:15 +0000 (12:01 -0400)
Need to check for option to be either submit or update for the deleting
of amenities or categories if none are set.

models/admin/events/list.php

index e1b9955..f90a405 100644 (file)
@@ -892,7 +892,7 @@ class GlmMembersAdmin_events_list extends GlmDataEvents
             } // For each category being submitted
 
             // Otherwise if this is a submission and there's no categories submitted, so make sure there's none stored
-        } elseif (isset($_REQUEST['option']) && $_REQUEST['option'] == 'submit') {
+        } elseif ( isset($_REQUEST['option']) && ( $_REQUEST['option'] === 'submit' || $_REQUEST['option'] === 'update' ) ) {
             $EventCategories->clearEventCategories($this->eventID);
         }
 
@@ -971,7 +971,7 @@ class GlmMembersAdmin_events_list extends GlmDataEvents
             } // For each amenity being submitted
 
             // Otherwise if this is a submission and there's no amenities submitted, so make sure there's none stored
-        } elseif (isset($_REQUEST['option']) && $_REQUEST['option'] == 'submit') {
+        } elseif (isset($_REQUEST['option']) && ( $_REQUEST['option'] === 'submit' || $_REQUEST['option'] === 'update' ) ) {
             $EventAmenities->clearEventAmenities($this->eventID);
         }