View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0001648 | OXID eShop (all versions) | 1.02. Price calculations (discounts, coupons, additional costs etc.) | public | 2010-02-05 13:35 | 2012-12-10 13:27 |
Reporter | andreas_ziethen | Assigned To | |||
Priority | immediate | Severity | block | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Fixed in Version | 4.5.0_beta3 | ||||
Summary | 0001648: Missing catch of warnings - especially on online-vat-id-check | ||||
Description | Today we got a call by a shop-owner: customers wrote him that the order process does not work any longer. One customer put this error messages in his email: --------------------------------------- Warning: SoapClient::SoapClient(http://ec.europa.eu/taxation_customs/vies/api/checkVatPort?wsdl) [soapclient.soapclient]: failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in /htdocs/www.voipango.de/core/oxonlinevatidcheck.php on line 137 Warning: SoapClient::SoapClient() [soapclient.soapclient]: I/O warning : failed to load external entity "http://ec.europa.eu/taxation_customs/vies/api/checkVatPort?wsdl" in /htdocs/www.voipango.de/core/oxonlinevatidcheck.php on line 137 Warning: Cannot modify header information - headers already sent by (output started at /htdocs/www.voipango.de/core/oxonlinevatidcheck.php:137) in /htdocs/www.voipango.de/core/oxutils.php on line 817 Warning: Cannot modify header information - headers already sent by (output started at /htdocs/www.voipango.de/core/oxonlinevatidcheck.php:137) in /htdocs/www.voipango.de/core/oxutils.php on line 818 Warning: Cannot modify header information - headers already sent by (output started at /htdocs/www.voipango.de/core/oxonlinevatidcheck.php:137) in /htdocs/www.voipango.de/core/oxutils.php on line 819 --------------------------------------- So no orders could be made if a customer used his VAT ID and company name. The warning is not catched so we should have a special handling vor warnings cause oxshopcontrol::_runonce() sets the error-handling to E_ALL ^ E_NOTICE if the server config logs errors. So I suggest to implement something like this into the whole exception handling stuff: set_error_handler("oxWarningHandler", E_WARNING); function oxWarningHandler($errno, $errstr) { // do something sensefull ... // and put it to EXCEPTION.log } | ||||
Tags | VAT | ||||
Attached Files | |||||
Theme | |||||
Browser | All | ||||
PHP Version | any | ||||
Database Version | any | ||||
related to | 0001687 | resolved | arvydas_vapsva | Online VAT-ID check not available anymore |
|
Looks like the service over this wsdl http://ec.europa.eu/taxation_customs/vies/api/checkVatPort?wsdl does not work any more. Need to investigate ASAP - which link should be used for this service. @Developers: please write some temporary workaround here if possible (i.e. disabling VAT ID check in source code), to allow order processing. |
|
given url does not work at the moment, so i made a module (attached), which disables soap call and marks Vat ID as valid. On urgent cases this may be helpful. To enable it add this to modules config: oxonlinevatidcheck => oxmodonlinevatidcheck |
|
URL does work now again ... - but as I said: we do need a proper handling for warnings here so that they do not hinder order processing |
|
we're working on that. Bad thing is that SOAP connection exception cant be cought by standard try/catch block. |
|
fixed |
|
in case you need ASAP fix just make a module for oxonlinevatidcheck class: class module extends module_parent { /** * Catches soap warning which is usually thrown due to setvice problems. * Return true and allows to continue process * * @param int $iErrNo error type number * @param string $sErrStr error message * @param string $sErrFile error file * @param int $iErrLine error line * * @return bool */ public function catchWarning( $iErrNo, $sErrStr, $sErrFile, $iErrLine ) { // message to write to exception log $sLogMessage = "Warning: $sErrStr in $sErrFile on line $iErrLine"; // fetching exception log file name $oEx = new oxException(); $sLogFileName = $oEx->getLogFileName(); // logs error message return oxUtils::getInstance()->writeToLog( $sLogMessage, $sLogFileName ); } /** * Checks online if USt.ID number is valid. * Returns true on success. On error sets error value. * * @param object $oCheckVat vat object * * @return bool */ protected function _checkOnline( $oCheckVat ) { // setting local error handler to catch possible soap errors set_error_handler( array( $this, 'catchWarning' ), E_WARNING ); $blReturn = parent::_checkOnline( $oCheckVat ); // restoring previous error handler restore_error_handler(); return $blReturn; } } |