Problem/Motivation

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

screenshot

But Olivero by default has comment form before comments.

screenshot

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"

Issue fork drupal-3439844

Command icon 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

ivnish created an issue. See original summary.

ivnish’s picture

Status: Active » Needs review
smustgrave’s picture

Status: Needs review » Needs work
Issue tags: +Needs upgrade path, +Needs subsystem maintainer review

Will need some form of upgrade path for the new settings.

Also tagging for sub-maintainer for their thoughts.

ivnish’s picture

Will need some form of upgrade path for the new settings.

Upgrade path is not needed in this case. The new setting is disabled by default and does not affect existing sites.

ivnish’s picture

Status: Needs work » Needs review
smustgrave’s picture

The 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.

ivnish’s picture

Issue tags: -Needs upgrade path

Upgrade hook added

krakenbite’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new30.75 KB
new37.08 KB

Looks good for me!

larowlan’s picture

Status: Reviewed & tested by the community » Needs review

Thanks folks we still need a subsystem maintainer opinion here - would suggest pinging one of the olivero maintainers in #frontend in slack

larowlan’s picture

Status: Needs review » Needs work

Left some comments on the MR - thanks folks

ivnish’s picture

Status: Needs work » Needs review
nod_’s picture

Not olivero maintainer, but it's ok with me.

krakenbite’s picture

Assigned: ivnish » Unassigned
Status: Needs review » Reviewed & tested by the community

  • nod_ committed 26e593af on 11.x
    Issue #3439844 by ivnish, KrakenBite, larowlan, smustgrave: Add setting...

  • nod_ committed 2ef2b350 on 10.3.x
    Issue #3439844 by ivnish, KrakenBite, larowlan, smustgrave: Add setting...
nod_’s picture

Version: 11.x-dev » 10.3.x-dev
Status: Reviewed & tested by the community » Fixed
Issue tags: -Needs subsystem maintainer review

Committed 26e593a and pushed to 11.x. Thanks!

  • nod_ committed 06ede619 on 10.3.x
    Revert "Issue #3439844 by ivnish, KrakenBite, larowlan, smustgrave: Add...

  • nod_ committed ff0bc592 on 11.x
    Revert "Issue #3439844 by ivnish, KrakenBite, larowlan, smustgrave: Add...

nod_’s picture

Version: 10.3.x-dev » 11.x-dev
Status: Fixed » Needs work

feedback incomming

alexpott’s picture

Added feedback to the MR.

ivnish’s picture

Status: Needs work » Needs review
alexpott’s picture

The 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

andypost’s picture

I 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

larowlan’s picture

@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.


    $element['form_location'] = [
      '#type' => 'checkbox',
      '#title' => $this->t('Show reply form on the same page as comments'),
      '#default_value' => $settings['form_location'],
    ];

needs-review-queue-bot’s picture

Status: Needs review » Needs work
StatusFileSize
new90 bytes

The 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.

ivnish’s picture

Issue summary: View changes
ivnish’s picture

Status: Needs work » Needs review

Added an "update test"

Also change record draft was created https://www.drupal.org/node/3467555

andypost’s picture

+1 to get in, just can't test 11.x with Bartok properly for BC but it's contributed theme now

kanchan bhogade’s picture

Status: Needs review » Needs work
StatusFileSize
new114.13 KB
new148.69 KB

Hi
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

ivnish’s picture

Status: Needs work » Needs review

@Kanchan Bhogade MR successfully applied to 11.x branch. See https://git.drupalcode.org/issue/drupal-3439844/-/pipelines/251360

kanchan bhogade’s picture

StatusFileSize
new117.73 KB
new71.34 KB

Hi
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

krakenbite’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new384.86 KB
new386.37 KB
new387.23 KB

I cannot reproduce issue from #34

All works as expected

Attaching Screenshots too

catch’s picture

Status: Reviewed & tested by the community » Needs review
Issue tags: +Needs subsystem maintainer review

Don'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.

andypost’s picture

should be configurable centrally in Drupal core, probably as a formatter setting

++ 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

andypost’s picture

Re #27

theme to make a setting for how to position the form when its on the same page

consider a case when you have 2 comment fields for the entity and and wanna configure it at comment field/type level...

andypost’s picture

ivnish’s picture

Hey, 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 :(

catch’s picture

99% themes render comment form after comments list, only olivero before.

Some 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.

catch’s picture

ivnish’s picture

Yes, I understand, but I don’t have enough time for it

sagarmohite0031’s picture

Hello
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.

andypost’s picture

I 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...

andypost’s picture

smustgrave’s picture

@sagarmohite0031 why did you remove all the tags?

needs-review-queue-bot’s picture

Status: Needs review » Needs work
StatusFileSize
new3.62 KB

The 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.

smustgrave’s picture

Status: Needs work » Needs review

False positive

needs-review-queue-bot’s picture

Status: Needs review » Needs work
StatusFileSize
new3.63 KB

The 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.

mrinalini9 made their first commit to this issue’s fork.

mrinalini9’s picture

Fixed PHPStan issues reported by the bot in #51 but still some tests are failing that need to be fixed.

Thanks!

ivnish’s picture

Status: Needs work » Needs review

Rebased. Please review

krakenbite’s picture

Status: Needs review » Reviewed & tested by the community
astonvictor’s picture

tested locally. works as expected
+1 RTBC

dcam made their first commit to this issue’s fork.

dcam’s picture

The 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.

pameeela’s picture

@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.

needs-review-queue-bot’s picture

Status: Reviewed & tested by the community » Needs work
StatusFileSize
new4.28 KB

The 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.

dcam’s picture

Status: Needs work » Needs review

There were two issues with the MR:

  1. theme_get_setting() is deprecated as of Drupal 11.3.0.
  2. The new Choice constraint lacked a choices key 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.

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

Not product manager but it’s been a few months hoping restoring the RTBC will get their attention

needs-review-queue-bot’s picture

Status: Reviewed & tested by the community » Needs work
StatusFileSize
new90 bytes

The 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.

dcam’s picture

Status: Needs work » Reviewed & tested by the community

Rebased. 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.

quietone’s picture

Issue summary: View changes

Pointing 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.

  • #26 the preferences if for changing the comment field formatter or comment type.
  • #27, the current implementation is preferred.
  • #36, catch prefers that this is "configurable centrally in Drupal core, probably as a formatter setting".
  • #59, no one needs a global setting, it is just Oliver that made an "odd design choice"

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.

xjm’s picture

Status: Reviewed & tested by the community » Needs review
Issue tags: +DrupalSouth 2026

@smustgrave Re:

Not product manager but it’s been a few months hoping restoring the RTBC will get their attention

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.

needs-review-queue-bot’s picture

Status: Needs review » Needs work
StatusFileSize
new90 bytes

The 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.