Submission DOI error

Hi @asmecher I’m trying to send DOI by CrossRefExportPlugin, but I take this error:

PHP Warning: assert(): Assertion failed in /PATH_BASE/classes/plugins/ on line 342, referer: http://URL/index.php/rbagroecologia/management/importexport/plugin/CrossRefExportPlugin
PHP Fatal error: Call to a member function setDeployment() on null in /PATH_BASE/classes/plugins/ on line 345, referer: http://URL/management/importexport/plugin/CrossRefExportPlugin

Hi @bozana can you help me?
I’m try send ou download XML DOI to CrossRef, the error is Call to a member function setDeployment() on null and point to call $exportFilter->setDeployment($exportDeployment);

function exportXML($objects, $filter, $context) {
                $xml = '';
                $filterDao = DAORegistry::getDAO('FilterDAO');
                $exportFilters = $filterDao->getObjectsByGroup($filter);
                assert(count($exportFilters) == 1); // Assert only a single serialization filter
                $exportFilter = array_shift($exportFilters);
                $exportDeployment = $this->_instantiateExportDeployment($context);
                $exportXml = $exportFilter->execute($objects, true);
                $xml = $exportXml->saveXml();
                $errors = array_filter(libxml_get_errors(), create_function('$a', 'return $a->level == LIBXML_ERR_ERROR || $a->level == LIBXML_ERR_FATAL;'));
                if (!empty($errors)) {
                        $charset = Config::getVar('i18n', 'client_charset');
                        header('Content-type: text/html; charset=' . $charset);
                        echo '<html><body>';
                        $this->displayXMLValidationErrors($errors, $xml);
                        echo '</body></html>';
                return $xml;

I can’t download to send manually or automatically send. Can you help me @bozana?