The module attempts to call exportables_sync_names('input_formats') when it's enabled but this is currently broken, causing the existing input_formats to not get synced until the next change is made to the input formats. This is a problem because other modules that attempt to use exportables won't see the existing formats. In particular it breaks WYSIWYG when the features patch is applied.

The issue is in the call to "drupal_write_record" in "exportables_machine_save". According to http://api.drupal.org/api/function/drupal_write_record calls to drupal_write_record fail in module enable hooks because it can't find the table in the schema yet.

Calling drupal_get_schema(NULL,TRUE) before the call to exportables_sync_names fixes the problem, but may not be the best solution.

I'm attaching a patch that adds the drupal_get_schema.

Comments

dagmar’s picture

Status: Active » Needs review
drewish’s picture

StatusFileSize
new571 bytes

I think putting hook_enable() inside the .module file is a bad idea because most developers will expect it to be in .install but won't move it in this patch. Re-rolling to add a space after the comma to follow the coding standards.

I won't mark my own patch as RTBC but it fixed the error I was encountering:

User warning: Table 'aws_d6.exportables' doesn't exist
query: SELECT id AS format FROM exportables WHERE type = 'input_formats' AND in_code = 0
in _db_query() (line 148 of includes/database.mysql.inc).

drewish’s picture

scottrigby’s picture

Status: Needs review » Reviewed & tested by the community

seems to do the trick

pol’s picture

New patch to get it working with drush make and Jenkins.

igor.ro’s picture

Hello.

I think we have this problem because of cycle dependence between input_formats and exportables http://drupal.org/node/1426950

We need to move sync to enable for module input_formats. And everything will be fine.

Here is the patch

dagmar’s picture

Status: Reviewed & tested by the community » Needs review

#5 and #6 are two different patches.

igor.ro’s picture

I do not get how you will use patch #5, because use have to disable exportables module first,
but it is required by input_formats module.
does I miss something?