diff options
| author | Silvio Rhatto <rhatto@riseup.net> | 2014-03-14 21:25:01 -0300 | 
|---|---|---|
| committer | Silvio Rhatto <rhatto@riseup.net> | 2014-03-14 21:25:01 -0300 | 
| commit | 3651c99a195685f3a868e159e72c4daf8cb371d3 (patch) | |
| tree | cb004dd7b6ca55215a2c20112fe0c5209d98c18e /engine/classes/ElggGroup.php | |
| parent | 97e689213ff4e829f251af526ed4e796a3cc2b71 (diff) | |
| parent | c2707bb867ddb285af85d7a0e75db26ef692d68c (diff) | |
| download | elgg-3651c99a195685f3a868e159e72c4daf8cb371d3.tar.gz elgg-3651c99a195685f3a868e159e72c4daf8cb371d3.tar.bz2 | |
Merge branch 'master' into saravea
Conflicts:
	mod/blog/views/default/blog/sidebar/archives.php
Diffstat (limited to 'engine/classes/ElggGroup.php')
| -rw-r--r-- | engine/classes/ElggGroup.php | 18 | 
1 files changed, 10 insertions, 8 deletions
| diff --git a/engine/classes/ElggGroup.php b/engine/classes/ElggGroup.php index 61f699f1a..7e69b7a84 100644 --- a/engine/classes/ElggGroup.php +++ b/engine/classes/ElggGroup.php @@ -48,21 +48,18 @@ class ElggGroup extends ElggEntity  					$msg = elgg_echo('IOException:FailedToLoadGUID', array(get_class(), $guid->guid));  					throw new IOException($msg);  				} - -			// Is $guid is an ElggGroup? Use a copy constructor  			} else if ($guid instanceof ElggGroup) { +				// $guid is an ElggGroup so this is a copy constructor  				elgg_deprecated_notice('This type of usage of the ElggGroup constructor was deprecated. Please use the clone method.', 1.7);  				foreach ($guid->attributes as $key => $value) {  					$this->attributes[$key] = $value;  				} - -			// Is this is an ElggEntity but not an ElggGroup = ERROR!  			} else if ($guid instanceof ElggEntity) { +				// @todo why separate from else  				throw new InvalidParameterException(elgg_echo('InvalidParameterException:NonElggGroup')); - -			// Is it a GUID  			} else if (is_numeric($guid)) { +				// $guid is a GUID so load entity  				if (!$this->load($guid)) {  					throw new IOException(elgg_echo('IOException:FailedToLoadGUID', array(get_class(), $guid)));  				} @@ -338,7 +335,7 @@ class ElggGroup extends ElggEntity  		$this->attributes = $attrs;  		$this->attributes['tables_loaded'] = 2; -		cache_entity($this); +		_elgg_cache_entity($this);  		return true;  	} @@ -355,7 +352,12 @@ class ElggGroup extends ElggEntity  		}  		// Now save specific stuff -		return create_group_entity($this->get('guid'), $this->get('name'), $this->get('description')); + +		_elgg_disable_caching_for_entity($this->guid); +		$ret = create_group_entity($this->get('guid'), $this->get('name'), $this->get('description')); +		_elgg_enable_caching_for_entity($this->guid); + +		return $ret;  	}  	// EXPORTABLE INTERFACE //////////////////////////////////////////////////////////// | 
