While trying to switch original language of a Commerce product type I've encountered longblob serialized data in config and key_value database tables.
Is there a quick way to edit them, possibly without writing a lot of PHP code?
Drupal Answers is a question and answer site for Drupal developers and administrators. It only takes a minute to sign up.
Sign up to join this communityWhile trying to switch original language of a Commerce product type I've encountered longblob serialized data in config and key_value database tables.
Is there a quick way to edit them, possibly without writing a lot of PHP code?
Don't edit the serialized config, edit the config as YAML. Try for example
drush cedit
See other options (UI and command line) here: https://www.drupal.org/docs/configuration-management
bin/drupal
CLI.
drush
and verified that it's working, thank you.
(added as a later edit)
It's possible that the values you need can be exported at
/admin/config/development/configuration/single/export
Then edited and re-imported at
/admin/config/development/configuration/single/import
Do not try it unless you can afford losing your database and you really understand what you are doing.
I've managed to edit it by using these SQL commands:
select hex('serialized string that you got with CAST(data as CHAR) here');
UPDATE `drupal_config` SET data=0xHEXVALUEFROMPREVIOUSSTEP WHERE name="commerce_product.commerce_product_type.yourproducttypemachinename";
The SQL does not expect there to be any translated values, select with WHERE name="commerce_product.commerce_product_type.yourproducttypemachinename"
should return only one row.