How To Create Admin Subdomain In Cloudflare with Nginx Proxy using Docker with SSL
Introduction I have my main website, which I run on Lets say: . Now, there is my…
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.
Introduction I have my main website, which I run on Lets say: . Now, there is my…
Introduction I was trying to download some youtube videos for my kids. As I have…
This post is dedicated for cases where we intend to append a variable value in a…
Introduction Lets take a look at how forms are being handled in ReactJS. We will…
Introduction In the ReactJS project, you are having aa parent component and a…
I wanted to fetch all image tags from a big html, and wanted to perform some…
Introduction In this post we will see following: How to schedule a job on cron…
Introduction There are some cases, where I need another git repository while…
Introduction In this post, we will see how to fetch multiple credentials and…
Introduction I have an automation script, that I want to run on different…
Introduction I had to write a CICD system for one of our project. I had to…
Introduction Java log4j has many ways to initialize and append the desired…