]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
clearing sticky form after it is used on edit form
authorCash Costello <cash.costello@gmail.com>
Fri, 7 Jun 2013 22:26:18 +0000 (18:26 -0400)
committerCash Costello <cash.costello@gmail.com>
Fri, 7 Jun 2013 22:26:18 +0000 (18:26 -0400)
actions/profile/edit.php
views/default/forms/profile/edit.php

index c2a124309353d513e4c3bcc6562af7a8890c9596..e1f066e827099048a45087841299e02f865b0582 100644 (file)
@@ -82,7 +82,7 @@ if (sizeof($input) > 0) {
                );
                elgg_delete_metadata($options);
                
-               if(!is_null($value) && ($value !== '')){
+               if (!is_null($value) && ($value !== '')) {
                        // only create metadata for non empty values (0 is allowed) to prevent metadata records with empty string values #4858
                        
                        if (isset($accesslevel[$shortname])) {
index aef180f36cab4cd56d7b9d2011a1ba48b2232f4d..cb0a37ca4e4e1cc625f9047f6aa5338ee08799a8 100644 (file)
@@ -13,7 +13,7 @@
 </div>
 <?php
 
-$stickyValues = elgg_get_sticky_values('profile:edit');
+$sticky_values = elgg_get_sticky_values('profile:edit');
 
 $profile_fields = elgg_get_config('profile_fields');
 if (is_array($profile_fields) && count($profile_fields) > 0) {
@@ -42,12 +42,12 @@ if (is_array($profile_fields) && count($profile_fields) > 0) {
                        $access_id = ACCESS_DEFAULT;
                }
 
-               //sticky form values take precedence over saved ones
-               if (isset($stickyValues[$shortname])) {
-                       $value = $stickyValues[$shortname];
+               // sticky form values take precedence over saved ones
+               if (isset($sticky_values[$shortname])) {
+                       $value = $sticky_values[$shortname];
                }
-               if (isset($stickyValues['accesslevel'][$shortname])) {
-                       $access_id = $stickyValues['accesslevel'][$shortname];
+               if (isset($sticky_values['accesslevel'][$shortname])) {
+                       $access_id = $sticky_values['accesslevel'][$shortname];
                }
 
 ?>
@@ -69,6 +69,9 @@ if (is_array($profile_fields) && count($profile_fields) > 0) {
 <?php
        }
 }
+
+elgg_clear_sticky_form('profile:edit');
+
 ?>
 <div class="elgg-foot">
 <?php