Following steps to reproduce:
- install Paragraphs module and Better Formats module
- create paragraph type with a formatted long text field
- create content type with paragraphs reference
- create a node, add a paragraph with the textfield and try to save the node
Result:
An error message "This value should not be null. " shows up and the the text filter select field under the paragraphs textfield is marked red although there is a valid value chosen. This does not appear to be an issue on textfields added to the content type directly.
When Better Format module is deinstalled the node can be saved without problems
Comment | File | Size | Author |
---|---|---|---|
#9 | combined-patch-2728477-2-and-2735633-6-into-2735633-9.patch | 986 bytes | rolfmeijer |
#6 | better-formats-lost-textfield-values-2735633-comment#5-d8.patch | 692 bytes | tobiberlin |
Comments
Comment #2
jonathanshawI can't reproduce that. Works fine for me.
Can you reproduce in a clean environment like simplytest.me with the latest paragraphs dev?
Comment #3
tobiberlinI change this issue as it seems that it belongs to Better Formats module.
In my installation I tried Better Formats and when I deinstall this module the problem disappears. I was already confused when I checked the values in
$form_state
as the values of the textfield seem to disappear in values array when Better Formats module is enabled. I did not go deeper into your code but for me it seems that there is something wrong?!I edit the above steps to reproduce the problem
Comment #4
tobiberlinedited steps to reproduce the problem
Comment #5
tobiberlinFound the problem. First of all it was not just related to paragraphs: the real problem was that no values were saved for the text fields and in my local installation only the paragraphs field was required. This was the only reason why the error message just appeared with this field. But for no textfield the value were saved
What I found out and changed: in
better_formats_filter_process_format()
in line 49 of the module file you usearray_shift()
to get the field name. This cuts out the first element of the$element['#parents']
and leads to some strange values in$form_state['values']
So I changed this as you can see in my commit. This solved my issue.
Comment #6
tobiberlinAdded patch
Please see that in line 54 the same array_slice() method is used but I have no time to go deeper into this case.
Comment #7
justAChris CreditAttribution: justAChris at Bounteous commentedLooks like a duplicate of #2709313: BF field is not validating. Leaving this open for now as the patch does contain a different solution.
Setting to Needs Review as a valid patch is provided.
Regarding line 54:
This should be ok since
$field_defaults
isn't used after this line.Comment #8
rolfmeijer CreditAttribution: rolfmeijer at Dutch Open Projects commentedThe patch of #6 did solve my issue with fields being empty.
Comment #9
rolfmeijer CreditAttribution: rolfmeijer at Dutch Open Projects commentedBecause the patches of #2728477: 500 error on add taxonomy term form submit (comment 2) and this issue (comment 6) are related to the same block of code, those patches cannot be used together. So I combined them into a single patch.
Comment #10
rolfmeijer CreditAttribution: rolfmeijer at Dutch Open Projects commentedAlso see #2754029: Settings have no affect on the field if it is in a Paragraph bundle #5.
Comment #11
Devin Carlson CreditAttribution: Devin Carlson commentedMarking as a duplicate of #2709313: BF field is not validating.