public function selected_plugintype_mismatch($detected) {

        $mform = $this->_form;
        $mform->addRule('plugintype', get_string('required'), 'required', null, 'client');
        $mform->setAdvanced('plugintype', false);
        $mform->setAdvanced('permcheck', false);
        $mform->insertElementBefore($mform->createElement('static', 'selectedplugintypemismatch', '',
            html_writer::span(get_string('typedetectionmismatch', 'tool_installaddon', $detected), 'error')), 'permcheck');
    }