0

I'm creating a custom Commerce License and I notice that I'm handling defaultConfiguration(), buildConfigurationForm(), submitConfigurationForm(), and buildFieldDefinitions(), but I cannot figure out where in the database this information is stored. I know that it must exist somewhere as the data loads up when I view the entity, but I cannot seem to find it. It doesn't seem to have anything to do with Configuration that would exist in a sync folder despite the similar names.

I'd assume buildFieldDefinitions() has something to do with it, but I cannot seem to figure out exactly what that method is doing at all.

7
  • All configuration is stored in the config table in the database.
    – Jaypan
    Commented Apr 14, 2020 at 3:04
  • Thought that'd be the case, but I don't see any entries whose names seem quite right. Do you know how the name col is set/determined in config?
    – Mrweiner
    Commented Apr 14, 2020 at 3:28
  • Depends on what you are configuring.
    – Jaypan
    Commented Apr 14, 2020 at 3:38
  • 2
    All configuration is exported to the sync folder as well. So why does it matter where it is stored in the database?
    – 4uk4
    Commented Apr 14, 2020 at 6:29
  • Because what I'm describing is specifically not in the exported site config at all. See the packaged commerce license plugin: git.drupalcode.org/project/commerce_license/-/blob/8.x-2.x/src/…. When a license is saved on a Product Variant, it's saved to $this->configuration['license_role']. Then when the edit form is loaded again, that value is used as the field default. But, exporting site config holds no reference to the value in $this->configuration['license_role'].
    – Mrweiner
    Commented Apr 14, 2020 at 6:44

1 Answer 1

1

Sounds like the answer is "the data is probably the config table... but it could also be anywhere else depending on the implementation." In the commerce_license example I noted, instances of LicenseTypes on Product variants get their own entry in commerce_product_variation__license_type, where the data for that instance is stored in the license_type_target_plugin_configration column. Just like data stored in the config table, this is a hex blob which, when decoded, is the config field data as a serialized array.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.