Multithreading in Python, Lets clear the confusion between Multithreading and Multiprocessing
So, you want to run your code in parallel so that your can process faster, or…
April 27, 2020
You already have a content type with one or more fields in it. Later, you realize you should rename it due to whatever reason. Lets take an example:
Drupal provides no way to rename existing fields of a content type. But, you can do this programatically or by a db query.
Do following steps:
$query = db_select( 'node', 'n' );
$query
->condition( 'n.type', 'article' )
->fields('n', array('nid'));
$result = $query
->execute()
->fetchAll();
foreach( $result as $row ) {
$nd = Drupal\node\Entity\Node::load($row->nid);
$nd->body = $nd->field_article_introduction;
$nd->field_image = $nd->field_top_image;
$nd->save();
}
The idea is to fetch all such nodes for that particular content type, and assign old values to the new fields you just created.
Clear the cache and test it.
So, you want to run your code in parallel so that your can process faster, or…
While dealing with ELastic Search documents, you faced this issue while updating…
Introduction I had to create many repositories in an Github organization. I…
You have drupal 7 image from docker hub, and want to connect tomongo db via php…
Problem Statement I’ve been using image styles, and heavily used “Scale and crop…
I have a Java project and dependencies are being managed through maven. I have…
Introduction So you have a Django project, and want to run it using docker image…
Introduction It is very important to introduce few process so that your code and…
Introduction In this post, we will see a sample Jenkin Pipeline Groovy script…
Introduction We often require to execute in timed manner, i.e. to specify a max…
Introduction In some of the cases, we need to specify namespace name along with…
Introduction In most of cases, you are not pulling images from docker hub public…