Problem/Motivation
A lot of sites with comments have comment form after comments. "Classic" Drupal themes too. Bartik for example

But Olivero by default has comment form before comments.

Steps to reproduce
Just create new node with comments
Proposed resolution
Add a setting to theme settings with checkbox where is render comments form
Remaining tasks
Needs subsystem maintainer review
Needs product manager review
Should the be a global setting or just something for Olivero, #66 has a wee summary.
User interface changes
Added a new checkbox to theme settings.
Introduced terminology
No
API changes
No
Data model changes
Added a new config variable "comment_form_position"
| Comment | File | Size | Author |
|---|
Issue fork drupal-3439844
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
ivnishComment #4
smustgrave commentedWill need some form of upgrade path for the new settings.
Also tagging for sub-maintainer for their thoughts.
Comment #5
ivnishUpgrade path is not needed in this case. The new setting is disabled by default and does not affect existing sites.
Comment #6
ivnishComment #7
smustgrave commentedThe upgrade hook should set the new config to false.
If I go to the olivero settings, change nothing, click save, and do a config export I'll get a new change now because the schema is different.
Comment #8
ivnishUpgrade hook added
Comment #9
krakenbite commentedLooks good for me!
Comment #10
larowlanThanks folks we still need a subsystem maintainer opinion here - would suggest pinging one of the olivero maintainers in #frontend in slack
Comment #11
larowlanLeft some comments on the MR - thanks folks
Comment #12
ivnishComment #13
nod_Not olivero maintainer, but it's ok with me.
Comment #14
krakenbite commentedComment #18
nod_Committed 26e593a and pushed to 11.x. Thanks!
Comment #22
nod_feedback incomming
Comment #23
alexpottAdded feedback to the MR.
Comment #24
ivnishComment #25
alexpottThe config changes look v nice... a couple of other thoughts...
We can add an update test to \Drupal\Tests\olivero\Functional\Update\OliveroPostUpdateTest
I think we can test the functionality in core/tests/Drupal/Nightwatch/Tests/Olivero/oliveroCommentTest.js
Comment #26
andypostI bet it needs change record, moreover it reminds me that we have comment type entity to store this kind of data
Personally I find comment field formatter or comment type is a better place to store position of the form.
Also it needs to revisit D6/7 migrations as there was related setting
Comment #27
larowlan@andypost pointed out that the comment field already includes a setting for 'form location' but that's only if its on the same page or a separate reply page. I think its ok for a theme to make a setting for how to position the form when its on the same page.
Comment #28
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".
This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.
Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.
Comment #29
ivnishComment #30
ivnishAdded an "update test"
Also change record draft was created https://www.drupal.org/node/3467555
Comment #31
andypost+1 to get in, just can't test 11.x with Bartok properly for BC but it's contributed theme now
Comment #32
kanchan bhogade commentedHi
I have reproduced the issue on Drupal 11 with the Olivero theme.
But the MR is falling for Drupal 11
Testing steps:
Just create a new node with comments
Attaching screenshot for reference
Comment #33
ivnish@Kanchan Bhogade MR successfully applied to 11.x branch. See https://git.drupalcode.org/issue/drupal-3439844/-/pipelines/251360
Comment #34
kanchan bhogade commentedHi
I have reproduced the issue on Drupal 11 with the Olivero theme.
The MR is applied cleanly...
Testing steps:
Just create a new node with comments
Test Result:
I have added 2 comments, but after applying the MR, the added comments are not visible only the count of comments is visible.
Attaching Screenshots
Comment #35
krakenbite commentedI cannot reproduce issue from #34
All works as expected
Attaching Screenshots too
Comment #36
catchDon't think this has been reviewed by an Olivero maintainer yet so tagging for that.
I think this is really something that should be configurable centrally in Drupal core, probably as a formatter setting. However we'd still need to remove the hard-coding of the form position in Olivero if we do that, but it would mean the position moves to the formatter settings instead of Olivero. Moving back to needs review for discussion.
Comment #37
andypost++ to get more opinions as there setting and default value when new theme enabled is tricky and same time option for comment form gonna be added in #2546116: Allow a sitebuilder to change the Comment form heading
Comment #38
andypostRe #27
consider a case when you have 2 comment fields for the entity and and wanna configure it at comment field/type level...
Comment #39
andypostLooking back I find @catch choice is preferable as initial intent was #1920044: Move comment field settings that relate to rendering to formatter options
Comment #40
andypostComment #41
ivnishHey, folks! I don't agree about formatter. 99% themes render comment form after comments list, only olivero before. Formatter setting will not be used by most users. And not every olivero users too.
I use olivero in my blog and formatter setting is not relevant for me. If this issue will not be commited to olivero, I have to refuse this issue :(
Comment #42
catchSome sites will want to render the comment form before the comments and will be overriding themes, so the formatter would help in that direction too.
Comment #43
catchComment #44
ivnishYes, I understand, but I don’t have enough time for it
Comment #45
sagarmohite0031 commentedHello
I have reproduced the issue for Olivero theme on Drupal 11.
The MR is applied successfully.
Testing steps-
Created new node and added comments.
Test Result:
Results are same before and after applied MR.
Check attachments.
Comment #46
andypostI think it all means that Olivero doing too many things that is not ready in comment module, like hardcoding comment form placement and comment count #2031903: Support per comment field comment count tokens via https://git.drupalcode.org/project/drupal/-/blob/11.x/core/themes/oliver...
Comment #47
andypostComment #48
smustgrave commented@sagarmohite0031 why did you remove all the tags?
Comment #49
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue. It fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".
This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.
Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.
Comment #50
smustgrave commentedFalse positive
Comment #51
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue. It fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".
This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.
Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.
Comment #53
mrinalini9 commentedFixed PHPStan issues reported by the bot in #51 but still some tests are failing that need to be fixed.
Thanks!
Comment #54
ivnishRebased. Please review
Comment #55
krakenbite commentedComment #56
astonvictor commentedtested locally. works as expected
+1 RTBC
Comment #58
dcam commentedThe MR for this issue was identified as having a new Kernel/Functional test class that did not have the
#[RunTestsInSeparateProcesses]attribute. A deprecation warning is now issued in the case of these omissions. I've rebased the MR added the attribute to prevent this from being committed as-is and accidentally breaking tests on HEAD. Because this is a minor change to test metadata and the tests are passing I am leaving the issue's status as RTBC.Comment #59
pameeela commented@catch asked about this in Slack. I understand why it would make more sense to put this outside of the theme if this was a feature request for “allow users to choose whether the comment form is before or after,” but no one seems to need that. This issue only exists because Olivero made an odd design choice, so to me a global setting, which increases the complexity of this, seems unnecessary.
Comment #60
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue. It fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".
This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.
Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.
Comment #61
dcam commentedThere were two issues with the MR:
theme_get_setting()is deprecated as of Drupal 11.3.0.Choiceconstraint lacked achoiceskey which is deprecated in Symfony 7.4.Fixing these were minor changes to correct easily verified problems and I considered self-RTBCing the issue again. But then I figured that three unreviewed commits to the MR in a row was probably a bridge too far. So I'm setting this back to Needs Review.
Comment #63
smustgrave commentedNot product manager but it’s been a few months hoping restoring the RTBC will get their attention
Comment #64
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".
This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.
Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.
Comment #65
dcam commentedRebased. This required making minor updates to remove the $has_trusted_config parameter and update the imported fixture to the new one from 11.3.0.
Comment #66
quietone commentedPointing out that this still needs signoffs and I have added that to the remaining task.
Reading the comments I see that there is not agreement on the implemented solution as shown by these comments.
If the current implementation is agreed to the change record needs updates. It should start with the change. And the branch/version need to be updated, and the reference to Bartik should be removed.
Comment #67
xjm@smustgrave Re:
The issue is also still tagged for subsystem maintainer review for Olivero, which product management likely needs to make an informed decision, so the correct status is NR.
Comment #68
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".
This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.
Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.