<commit_before><?php
/** $Id$ */

class ComLogsControllerLog extends ComDefaultControllerDefault
{
    public function __construct(KConfig $config)
    {
        parent::__construct($config);
        
        $this->_request->package = $config->package;
        
        if ($this->isDispatched() && $config->package) {
            $this->_request->layout = 'package_list';
            
            // Inherit the views from the calling component's view
            $view = clone $this->getView()->getIdentifier();
            $view->package = $config->package;
            
            $this->getView()->views = KFactory::get($view)->views;
        }
    }
    
    protected function _initialize(KConfig $config)
    {
        $config->append(array(
            'package' => null,
        ));
        
        parent::_initialize($config);
        
        $config->view = 'admin::com.logs.view.logs.html';
        $config->model = 'admin::com.logs.model.logs';
        $config->toolbar = 'admin::com.logs.controller.toolbar.logs';
    }
    
    public function getToolbar()
    {
        $toolbar = parent::getToolbar();
        
        if ($this->_request->package && $this->isDispatched()) {
            $toolbar->setTitle(ucfirst($this->_request->package).' Logs');
        }
        
        return $toolbar;
    }
}<commit_msg>re #15 - Avoid a weird bug where the IDs of selected items are saved as persistent state resulting to a query where only those IDs are selected. Now it doesn't include the ID when loading persistent state.<commit_after><?php
/** $Id$ */

class ComLogsControllerLog extends ComDefaultControllerDefault
{
    public function __construct(KConfig $config)
    {
        parent::__construct($config);
        
        $this->_request->package = $config->package;
        
        if ($this->isDispatched() && $config->package) {
            $this->_request->layout = 'package_list';
            
            // Inherit the views from the calling component's view
            $view = clone $this->getView()->getIdentifier();
            $view->package = $config->package;
            
            $this->getView()->views = KFactory::get($view)->views;
        }
    }
    
    protected function _initialize(KConfig $config)
    {
        $config->append(array(
            'package' => null,
        ));
        
        parent::_initialize($config);
        
        $config->view = 'admin::com.logs.view.logs.html';
        $config->model = 'admin::com.logs.model.logs';
        $config->toolbar = 'admin::com.logs.controller.toolbar.logs';
    }
    
    public function getToolbar()
    {
        $toolbar = parent::getToolbar();
        
        if ($this->_request->package && $this->isDispatched()) {
            $toolbar->setTitle(ucfirst($this->_request->package).' Logs');
        }
        
        return $toolbar;
    }
    
    public function loadState(KCommandContext $context)
	{
		// Built the session identifier based on the action
		$identifier  = $this->getModel()->getIdentifier().'.'.$context->action;
		$state       = KRequest::get('session.'.$identifier, 'raw', array());
		$state['id'] = null;
        
		//Append the data to the request object
		$this->_request->append($state);
		
		//Push the request in the model
		$this->getModel()->set($this->getRequest());
		
		return $this;
	}
}
{'fraction_non_alphanumeric': 0.14798206278026907, 'fraction_numerical': 0.0005979073243647235, 'mean_word_length': 2.1806083650190113, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 61, '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': '2366713', 'n_tokens_mistral': 928, 'n_tokens_neox': 913, 'n_words': 191}