Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
When we enable translation for a content type with a not translatable (no translation enabled) paragraphs field, we create a node and attempt to translate it, we get a error like:
Field content_translation_source is unknown.
Proposed resolution
Fix it.
Write tests.
Remaining tasks
User interface changes
API changes
Data model changes
Comment | File | Size | Author |
---|---|---|---|
#9 | paragraph_with_no-2761493-9.patch | 4.2 KB | johnchque |
#9 | interdiff-2761493-4-9.txt | 1.56 KB | johnchque |
#9 | paragraph_with_no-2761493-9-test-only.patch | 2.15 KB | johnchque |
#4 | paragraph_with_no-2761493-4.patch | 4.21 KB | johnchque |
#4 | paragraph_with_no-2761493-4-test-only.patch | 2.15 KB | johnchque |
Comments
Comment #2
miro_dietikerI don't get the description...
It sounds like i would always trigger this condition when doing multilingual setup?
Step by step please...
(A test? And a fix? ;-) )
Comment #3
johnchqueComment #4
johnchqueDiscussed with @Berdir this fix should be enough, the paragraph that is displayed on translation is the one available for all languages. :)
Comment #8
BerdirThe comment isn't correct, that's not what it is doing.
The source field is a base field. It is added if at least one paragraph type is translatable. But it existing doesn't mean that the paragraph type that you have is actually translatable. And it's even less about the paragraph field.
As quickly discussed, the question is, what should we do if the paragraph type is indeed not translatable? Maybe not show the paragraph at all. Or show a message that paragraph type X is not translatable? I'm not sure..
I'd also be ok with saying we just prevent the error for now and figure that out later. But then we need a better comment and I think we should have a single wrapping if() around the whole multilingual thingies. And maybe an "All languages" suffix on the label, like core has for shared fields?
Comment #9
johnchqueManually testing, when a paragraph is not translatable it is always displayed with a (all languages), actually IMHO it makes sense to displayed and the if added works fine in that way.
Comment #13
miro_dietikerImproved some comments and committed. :-)
Still back to needs work to create follow-ups about the workflow in the situation. We need to decide what experience is the goal.
Comment #14
miro_dietikerSry, accidentally committed with reference and message to #2755897: Cannot use paragraphs within Contact form
Comment #15
BerdirI have a feeling those follow-ups aren't going to be created if it didn't happen in the last two years and we likely fixed the problems we identified or there are open issues about it.