I have uc_product module installed, and add a content type called course_booking as a product class (admin/store/products/classes)
base: uc_product
When I use Synchronize method, it reverts it back to node content.
base: node_content
-------
Bernard Szlachta
http://www.nobleprog.co.uk/drupal/training
http://www.nobleprog.us/drupal-training-courses
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | 1957970-imported-content-type-base-1.patch | 978 bytes | bburg |
Comments
Comment #0.0
bnobleman commentedadded signature
Comment #1
bburgWe were stung by this issue as well. My colleague, wwhurley, uncovered the most likely cause:
Drupal\configuration\Config\ContentTypeConfiguration::saveToActiveStore() is implemented as follows:
Which assumes that the 'base' value is node_content and that the 'module' is node. These values can vary, like in bnobleman's example of course_booking, or in the example that had us tripped up, the Poll content type provided by Core's Poll module. Specifically, when Poll attempts to attach extra fields (the poll question itself), which depends on these values in node_type table. My experience with the Configuration module is limited, but here are my thoughts.
What seems to be happening is that during an "Import DataStore to ActiveStore" process, the normal default values are overridden. Any previously exported value (from Active to Data, which likely would have been correct) is overwritten, but once you import from the DataStore to the Active, the values are no longer used and any subsequent exports overwrite the correct ones in the DataStore.
The ContentTypeConfiguration class' constructor sets the key values (The main properties stored in configuration) for the component. These keys are missing the 'module' value mentioned above. So 'module' might need be added as one of the keys although I'm not certain that adding 'module' to the key definitions in the constructor actually matters. Since 'module' is one of the properties returned by node_type_get_type() in the handler's prepareBuild() method, it should be checked before overwriting it in saveToActiveStore().
Attached is a patch doing what I describe, but again, I am unfamiliar with this module, so there may very well be something more complex here that I am not considering.
Comment #2
dagmarComment #3
wwhurley commentedApplying the patch by bburg resolved the issue.
Comment #4
Renee S commentedWorks for me... commit?