2

I installed Drupal 8 on my site and used migrate to migrate my old site Drupal 6 to Drupal 8.

The error message pop out.

enter image description here

But when total articles have been all imported to new site Drupal 8.

The content of the article is not displaying. Only title of article shown.

I checked the article, there is content there.

It needs to be change from text format FULL HTML to BASIC HTML to make it appear on the site.

enter image description here

I have more than 20,000 articles. How do I do change it for all?

Is it adding the script here and press "Format"? enter image description here

enter image description here

  • The db_update is for use in Drupal, answer updated with raw SQL option too – David Thomas Jun 22 '16 at 9:38
3

While you might just need to add/configure the full_html text format, you can update the text format for all body fields to basic_html via a DB query ( and clear cache )

db_update('node__body')
  ->fields(array('body_format' => 'basic_html'))
  ->condition('bundle', 'article')
  ->execute();

db_update('node_revision__body')
  ->fields(array('body_format' => 'basic_html'))
  ->condition('bundle', 'article')
  ->execute();

The raw SQL equivalent (e.g for PHPMyAdmin) is:

UPDATE node__body set body_format = 'basic_html' where bundle = 'article';
UPDATE node_revision__body set body_format = 'basic_html' where bundle = 'article';

Backup your database first

|improve this answer|||||
  • Do you mean add the script here i.stack.imgur.com/t44pv.jpg – user73963 Jun 22 '16 at 5:47
  • @user73963 the code is for Drupal usage. Answer updated with raw SQL option – David Thomas Jun 22 '16 at 9:40
  • it show me this # MySQL returned an empty result set (i.e. zero rows) and the article format is still full html. i.stack.imgur.com/qmS79.jpg @David Thomas – user73963 Jun 24 '16 at 1:59
  • @user73963 the above assumes you're matching only the 'article' content type. make sure you clear cache at admin > config > performance > clear cache ( /admin/config/development/performance ) – David Thomas Jun 24 '16 at 4:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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