Problem/Motivation
This module would be useful to us if it worked
Steps to reproduce
Add the following to a custom module's .module file as per other hooks.
function cnt_etranslation_post_update_refield_cnt_accordion_question(&$sandbox) {
$field_map['paragraph'] = [
'cnt_accordion_question' => 'text_long',
];
return \Drupal\field_type_converter\FieldTypeConverter::processBatch($sandbox, $field_map);
}
The difference here is that the entity type is paragraph rather than node.
But the code falls over at the return line with the error
Error: Class "Drupal\field_type_converter\FieldTypeConverter" not found in cnt_faq_post_update_refield_cnt_accordion()
It tried adding the namespace
use Drupal\field_type_converter\FieldTypeConverter;
then changing return line to
return FieldTypeConverter::processBatch($sandbox, $field_map);
But the error is the same.
What am I doing wrong here, or is the lack of a service declaration in cnt_etranslation.services.yml the issue?
Comments
Comment #2
hawkeye.twolfPotentially silly question but is the `field_type_converter` module enabled? Drupal autoloads (makes available) only those source files when the module they're inside is enabled.
Comment #3
technotim2010 commentedHi
Meet Homer Simpson.
DOH!!!
You are quite right.
I think my brain is in Christmas mode.
I am sure I turned it on by drush but clearly it didn't complete.
Will try again.
Merry Christmas and a Happy New Year
Tim
Comment #4
technotim2010 commentedHi
Of course it works now.
Tim