Using Services module and drupal_form_submit to create a node, I get Illegal choice 0 in Comments element in form.inc:1266
Dumping the element at this point yields:
[#options] => Array
(
[2] => Open
[1] => Closed
)
I've tracked this down to the "hidden" option being removed in the comment module line 1229.
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | drupal7.comment-hidden.10.patch | 851 bytes | Everett Zufelt |
| #7 | drupal8.comment-hidden.7.patch | 871 bytes | sun |
| #3 | 1181750.patch | 1.03 KB | Everett Zufelt |
Comments
Comment #1
sunComment #2
dixon_This one is related, but not really the same: #989452: Make comment settings form more usable
Comment #3
Everett Zufelt commentedRewords description of 'Hidden' comment setting, and removes code that removes the 'Hidden' option for nodes without existing comments.
Comment #5
Everett Zufelt commented#3: 1181750.patch queued for re-testing.
Comment #6
Everett Zufelt commentedCannot reproduce install failure on head or head + patch.
Comment #7
sunAttached patch is what you want. As this needs to be backported, no UI string changes here.
Comment #8
Everett Zufelt commentedSun's patch looks good. I wasn't aware of the #access property, but this will allow the UI to remain the same, while allowing for programmatic submission of a form with the comment setting set to 'Hidden'.
Comment #9
catchYep, should always use #access rather than unsetting elements. Committed/pushed to 8.x, moving to 7.x for backport.
Comment #10
Everett Zufelt commentedPorted to d7
Comment #11
Everett Zufelt commentedComment #12
catchPlease leave the tag. It's the only way to distinguish between patches that have already been committed to 8.x, vs. new patches in the queue against 7.x (which are mis-placed 99% of the time).
Comment #14
sunComment #15
webchickHm. it seems lke we could add a test for this, but since #access is unlikely to get un-done, I guess it can go in without.
Committed and pushed to 7.x. Thanks!
Comment #16
xjmI think a test would be a good idea in this case. Moving to 8.x for a followup with a test.
Comment #17
tte commentedComment #18
yesct commentedComment #19
andypostTests could be added to
\Drupal\comment\Tests\CommentInterfaceTestthe fixed code now lives in\Drupal\comment\Plugin\Field\FieldWidget\CommentWidgetComment #20
andypostThere's issue to add tests #1847540: [META] Clean up comment module tests and decouple from node