- Issue created by @ludo.r
- First commit to issue fork.
- @ranjit1032002 opened merge request.
- 🇧🇪Belgium ludo.r Brussels
It appears that this happens with
content_moderation
module enabled, on themoderation_state
field.For now I circumvented this issue like this:
// Clone the field. $original_field = $data['field']; if (method_exists($original_field, 'createDuplicate')) { // Do stuff. }
- Status changed to Needs work
9 months ago 2:51pm 21 May 2024 - 🇨🇭Switzerland redzeuf Geneva
I had the same issue with module "Content Moderation" enabled and this fix works for me.
Needs to contrib the patch files. - First commit to issue fork.
- Status changed to Needs review
9 months ago 3:27pm 21 May 2024 - 🇺🇸United States selwynpolit
I applied this MR and it worked fine for me. I didn't dig into any side effects this may have on Content Moderation. It does report that a field could not be cloned because the createDuplicate method does not exist. I suspect it isn't really an issue though.
- 🇺🇸United States jnicola
Same issue for us at USDOJ:
Call to undefined method Drupal\Core\Field\BaseFieldDefinition::createDuplicate() in Drupal\content_type_clone\Form\CloneContentType::cloneContentTypeField() (line 67 of modules/contrib/content_type_clone/src/Form/CloneContentType.php).
This MR fixed the issue, though there was a drupal message stating:
"The field moderation_state cannot be cloned because the createDuplicate method does not exist."
Perhaps expected, and everything worked for the most part so.. good to go?
- 🇺🇸United States jnicola
Marking as reviewed and tested by the community. Enough folks have weighed in on this one, it's good to go and improves the module.