Browse Source

Added comments to warn about the discussion in sonata-project/SonataAdminBundle#1351

ddebree 12 years ago
parent
commit
05ef01c96b
1 changed files with 5 additions and 0 deletions
  1. 5 0
      Mapper/BaseGroupedMapper.php

+ 5 - 0
Mapper/BaseGroupedMapper.php

@@ -67,6 +67,8 @@ abstract class BaseGroupedMapper extends BaseMapper
      */
     protected function addFieldToCurrentGroup($fieldName) 
     {
+        //Note this line must happen before the next line. 
+        //See https://github.com/sonata-project/SonataAdminBundle/pull/1351
         $currentGroup = $this->getCurrentGroupName();
         $groups = $this->getGroups();
         $groups[$currentGroup]['fields'][$fieldName] = $fieldName;
@@ -77,6 +79,9 @@ abstract class BaseGroupedMapper extends BaseMapper
      * Return the name of the currently selected group. The method also makes 
      * sure a valid group name is currently selected
      * 
+     * Note that this can have the side effect to change the "group" value
+     * returned by the getGroup function
+     * 
      * @return string
      */
     protected function getCurrentGroupName()