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();
}
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.
@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.
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: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/ormodule_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.