Index: branches/RC/core/units/languages/import_xml.php =================================================================== diff -u -N -r11188 -r11538 --- branches/RC/core/units/languages/import_xml.php (.../import_xml.php) (revision 11188) +++ branches/RC/core/units/languages/import_xml.php (.../import_xml.php) (revision 11538) @@ -310,7 +310,7 @@ case 'LANGUAGES LANGUAGE EVENTS EVENT': $this->current_event = Array( 'EmailMessageId'=> 0, 'LanguageId' => $this->current_language['LanguageId'], - 'EventId' => $this->events_hash[ $attributes['EVENT'].'_'.$attributes['TYPE'] ], + 'EventId' => $this->_getEventId($attributes['EVENT'], $attributes['TYPE']), 'MessageType' => $attributes['MESSAGETYPE'], 'Template' => ''); break; @@ -321,6 +321,13 @@ // if($path == 'SHIPMENT PACKAGE') } + function _getEventId($event_name, $event_type) + { + $cache_key = $event_name . '_' . $event_type; + + return array_key_exists($cache_key, $this->events_hash) ? $this->events_hash[$cache_key] : 0; + } + function characterData(&$parser, $line) { $line = trim($line); @@ -391,6 +398,11 @@ break; case 'LANGUAGES LANGUAGE EVENTS EVENT': + if (!$this->current_event['EventId']) { + // language pack contains event translation, that's name is not found in Events table + continue; + } + if ($this->current_language['Encoding'] == 'plain') { $this->current_event['Template'] = rtrim($this->current_event['Template']); // nothing to decode!