<commit_before><?php
class Vpc_Forum_Directory_Controller extends Vps_Controller_Action_Auto_Vpc_Tree
{
    protected $_buttons = array(
        'add' => true, 'edit' => true, 'delete' => true,
        'invisible' => true, 'reload' => true, 'moderators' => true
    );
    protected $_rootVisible = true;
    protected $_textField = 'name';
    protected $_editDialog = array('controllerUrl'=>'/admin/component/edit/Vpc_Forum_Directory_Form',
                                   'width'=>450,
                                   'height'=>200);

    public function jsonDeleteAction()
    {
        $id = $this->getRequest()->getParam('id');
        $row = $this->_table->find($id)->current();

        $threadTable = new Vpc_Forum_Thread_Model();
        $threadRow = $threadTable->fetchRow(
            array('component_id = ?' => $row->component_id.'_'.$row->id)
        );

        if ($threadRow) {
            $this->view->error = 'Gruppe kann nicht gelöscht werden - es sind noch Themen vorhanden.';
        } else {
            parent::jsonDeleteAction();
        }
    }
}<commit_msg>Bug bei Group löschen im Backend<commit_after><?php
class Vpc_Forum_Directory_Controller extends Vps_Controller_Action_Auto_Vpc_Tree
{
    protected $_buttons = array(
        'add' => true, 'edit' => true, 'delete' => true,
        'invisible' => true, 'reload' => true, 'moderators' => true
    );
    protected $_rootVisible = true;
    protected $_textField = 'name';
    protected $_editDialog = array('controllerUrl'=>'/admin/component/edit/Vpc_Forum_Directory_Form',
                                   'width'=>450,
                                   'height'=>200);

    public function jsonDeleteAction()
    {
        $id = $this->getRequest()->getParam('id');
        $row = $this->_table->find($id)->current();

        $threadTable = new Vpc_Forum_Group_Model();
        $threadRow = $threadTable->fetchRow(
            array('component_id = ?' => $row->component_id.'_'.$row->id)
        );

        if ($threadRow) {
            $this->view->error = 'Gruppe kann nicht gelöscht werden - es sind noch Themen vorhanden.';
        } else {
            parent::jsonDeleteAction();
        }
    }
}
{'fraction_non_alphanumeric': 0.14636363636363636, 'fraction_numerical': 0.005454545454545455, 'mean_word_length': 2.334848484848485, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 43, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1537301', 'n_tokens_mistral': 652, 'n_tokens_neox': 637, 'n_words': 125}