Wanting to add field to some entity (we here pick order entity) by code, for example when deploying to production, use this snippet of code and you will have this new field added.
Wanting to add field to some entity (we here pick order entity) by code, for example when deploying to production, use this snippet of code and you will have this new field added.
I finally converted this old blog from drupal 6 to drupal 8. Good starting point is this page
https://www.drupal.org/docs/8/upgrade/upgrading-from-drupal-6-or-7-to-d…
Maybe you will stumble upon some site or service that will still serve XML and not JSON. TO fix this to your most liked format use this on that XML string
For debugging purposes I need to clear cache for particular drupal commerce order, but this can be done for any entity, just replace table name and id's in code below
$table = 'cache_entity_commerce_order';
$id ="776764";
cache_clear_all($id, $table);
Here is nice little snippet I use when I need to list all or some of the products from drupal commerce in select field in some forms, for example entity form.
Run this in terminal
drush php-eval "drush_print_r(db_select('system', 's') ->fields('s', array('weight')) ->condition('name', 'some_module', '=') ->execute() ->fetchField())";
and then when you get the required modules weight, change it with
Caching per block can be quite useful, depending on how much blocks you have in page, but odds are you are going to have some in footer and header.
Just go and run this into devel/php
db_query("update elysia_cron set running = 0 where name = 'search_cron'");
where in this case I am unstucking cron job for search indexing.
If you want to wipe out current search index, because you maybe made custom search module to quickly wipe out search tables run this into devel/php and you are starting from scratch
If you need to check something quickly with devel module. You can use db_query and put any sql command in it. Like
$query = db_query("SELECT * FROM `block` WHERE `delta` LIKE 'main_menu' ORDER BY `theme` DESC"); foreach($query as $result) { dpm($result); }
and dpm results to see what are the values.