<commit_before><?php
/**
 * Wraps around a TreedropdownField to add ability for temporary
 * switching of subsite sessions.
 * 
 * @package subsites
 */
class SubsitesTreeDropdownField extends TreeDropdownField {
	
	protected $subsiteID = 0;
	
	protected $extraClasses = array('SubsitesTreeDropdownField');
	
	function Field() {
		$html = parent::Field();
		
		Requirements::javascript('subsites/javascript/SubsitesTreeDropdownField.js');
		
		return $html;
	}
	
	function setSubsiteID($id) {
		$this->subsiteID = $id;
	}
	
	function getSubsiteID() {
		return $this->subsiteID;
	}
	
	function gettree() {
		$oldSubsiteID = Session::get('SubsiteID');
		Session::set('SubsiteID', $this->subsiteID);
		
		$results = parent::gettree();
		
		Session::set('SubsiteID', $oldSubsiteID);
		
		return $results;
	}
	
	function getsubtree() {
		$oldSubsiteID = Session::get('SubsiteID');
		Session::set('SubsiteID', $this->subsiteID);
		
		$results = parent::getsubtree();
		
		Session::set('SubsiteID', $oldSubsiteID);
		
		return $results;
	}
}
?><commit_msg>BUGFIX: TreeDropdownField::gettree() not exist, we should call TreeDropdownField::tree() wherever it is invoked, the bug is addressed by open ticket #4970<commit_after><?php
/**
 * Wraps around a TreedropdownField to add ability for temporary
 * switching of subsite sessions.
 * 
 * @package subsites
 */
class SubsitesTreeDropdownField extends TreeDropdownField {
	
	protected $subsiteID = 0;
	
	protected $extraClasses = array('SubsitesTreeDropdownField');
	
	function Field() {
		$html = parent::Field();
		
		Requirements::javascript('subsites/javascript/SubsitesTreeDropdownField.js');
		
		return $html;
	}
	
	function setSubsiteID($id) {
		$this->subsiteID = $id;
	}
	
	function getSubsiteID() {
		return $this->subsiteID;
	}
	
	function gettree(SS_HTTPRequest $request) {
		$oldSubsiteID = Session::get('SubsiteID');
		Session::set('SubsiteID', $this->subsiteID);
		
		$results = parent::tree($request);
		
		Session::set('SubsiteID', $oldSubsiteID);
		
		return $results;
	}
	
	function getsubtree() {
		$oldSubsiteID = Session::get('SubsiteID');
		Session::set('SubsiteID', $this->subsiteID);
		
		$results = parent::getsubtree();
		
		Session::set('SubsiteID', $oldSubsiteID);
		
		return $results;
	}
}
?>
{'fraction_non_alphanumeric': 0.14380238200264667, 'fraction_numerical': 0.002646669607410675, 'mean_word_length': 4.741772151898735, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4803865', 'n_tokens_mistral': 837, 'n_tokens_neox': 719, 'n_words': 150}