tableau-mkt-archived / entity_xliff

Drupal module that provides an API for entity serialization in the XLIFF format.
https://drupal.org/project/entity_xliff
2 stars 0 forks source link

Better handling for module includes #113

Closed iamEAP closed 7 years ago

iamEAP commented 8 years ago

Problem / motivation

Depending on the state of the Entity module's cache at any given time, it's possible for imports to catastrophically break. The most noticeable symptom for us: target translations intermittently and irreversibly overwriting source translations on import. This is extremely rare, but happens about once a month.

You can force these errors to happen by forcibly including all module includes on all requests. A Travis CI run with this issue can be found here. You could also add the following code to entity_xliff.module to get the same outcome:

function entity_xliff_init() {
  _entity_xliff_load_module_incs();
}

More useful reproduction steps available here: https://github.com/tableau-mkt/entity_xliff/pull/117

Proposed resolution

Always load Entity XLIFF module include files (or do something as outlined below in the original report). Investigate the test failures and resolve them.

Original report

Coming off of #112. The way we handle hook/module includes for modules for which we provide functionality (everything in the modules directory) is error-prone.

Unless we explicitly call the _entity_xliff_load_module_incs() function before every hook/alter invocation, there's a possibility that functionality we provide could be unintentionally lost.

We should create a wrapper/s around drupal_alter() and/or module_invoke() that calls the the includes loader before invoking the hook. Then, we should replace all of our existing calls with the new wrapper/s.

iamEAP commented 8 years ago

@pvanoverbeek FYI, bumping this to a pri-next; I believe that resolving this will resolve the ocassional (monthly) fire fighting we have to do when a KitchenSync import completely wipes out a page.