<commit_before><?php
	$object = compact('error', 'action', 'id');
	
	if ($action == 'duplicate')
	{
		$object += compact('old_id');
		$type = array('buro', 'many_children', 'view');
		if (!isset($data)) $data = array();
		$object['content'] = $this->Jodel->insertModule($model_class_name, $type, $data);
		$object['order'] = $order-1;
	}
	
	if ($action == 'edit')
	{
		$type = array('buro', 'many_children', 'form');
		$object['content'] = $this->Jodel->insertModule($model_class_name, $type, $data);
	}
	
	if ($action == 'afterEdit')
	{
		$type = array('buro', 'many_children', 'view');
		$object['content'] = $this->Jodel->insertModule($model_class_name, $type, $data);
		if (isset($id_order))
			$object['id_order'] = $id_order;
	}
	
	echo $this->Js->object($object);<commit_msg>Fixing a bug on duplicate: now checking if $order is set<commit_after><?php
	$object = compact('error', 'action', 'id');
	
	if ($action == 'duplicate')
	{
		$object += compact('old_id');
		$type = array('buro', 'many_children', 'view');
		if (!isset($data)) $data = array();
		$object['content'] = $this->Jodel->insertModule($model_class_name, $type, $data);
		if (isset($order))
			$object['order'] = $order-1;
	}
	
	if ($action == 'edit')
	{
		$type = array('buro', 'many_children', 'form');
		$object['content'] = $this->Jodel->insertModule($model_class_name, $type, $data);
	}
	
	if ($action == 'afterEdit')
	{
		$type = array('buro', 'many_children', 'view');
		$object['content'] = $this->Jodel->insertModule($model_class_name, $type, $data);
		if (isset($id_order))
			$object['id_order'] = $id_order;
	}
	
	echo $this->Js->object($object);
{'fraction_non_alphanumeric': 0.23879680785758134, 'fraction_numerical': 0.0012277470841006752, 'mean_word_length': 5.269230769230769, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 19, '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': '2893630', 'n_tokens_mistral': 642, 'n_tokens_neox': 595, 'n_words': 115}