Updated: Comment #N

Problem/Motivation

Lots of custom code to create /forum and /forum/x
Lets see if we can drop a lot of it and use views.

I say 'lets see' because my first attempt didn't get very far, so we'll need some custom handlers.
forum test

Proposed resolution

Attempt to replace /forum and /forum/x with views

Remaining tasks

Everything

User interface changes

Views instead of custom foo.

API changes

Most likely changes to ForumManagerInterface.

Issue fork forum-2207263

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

xjm’s picture

Priority: Normal » Major
Issue tags: +beta target
xjm’s picture

xjm’s picture

Status: Active » Needs review

Status: Needs review » Needs work

The last submitted patch, forum.views_.patch, failed testing.

oadaeh’s picture

The attached patch no longer applies, and when manually recreating it, no longer works as advertised. I started working on it, but haven't got far enough to address the functionality that no longer works.

Status: Needs work » Needs review

rfmarcelino queued forum.views_.patch for re-testing.

rfmarcelino’s picture

Status: Needs review » Needs work

The last submitted patch, forum.views_.patch, failed testing.

rfmarcelino’s picture

xjm’s picture

Version: 8.0.x-dev » 8.2.x-dev
Issue tags: -beta target

This issue was marked as a beta target for the 8.0.x beta, but is not applicable as an 8.1.x beta target, so untagging.

As a disruptive change, this would need to be targeted for 8.2.x at this point.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.0-beta1 was released on August 3, 2016, which means new developments and disruptive changes should now be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

larowlan’s picture

Issue tags: +Needs reroll
manuel garcia’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll
StatusFileSize
new19.92 KB

Rerolled, omitted this change:

+++ b/core/modules/taxonomy/taxonomy.views.inc
@@ -338,6 +338,7 @@ function taxonomy_views_data() {
+      'id' => 'standard',

This is now already done on Drupal\taxonomy\TermViewsData::getViewsData()

manuel garcia’s picture

Status: Needs review » Needs work

I've been playing around with the patch, the view doesn't even show up. Looks to me like we might be better off with rebuilding the view by hand.

We should probably do that, export it and put it under core/modules/forum/config/optional/views.view.forum_forums.yml

cebasqueira’s picture

StatusFileSize
new19.95 KB
cebasqueira’s picture

Status: Needs work » Needs review
faline’s picture

Status: Needs review » Reviewed & tested by the community

It's works for me!

manuel garcia’s picture

Status: Reviewed & tested by the community » Needs work

Thanks @cebasqueira, for those wondering, patch #15 moves the file into the optional folder.

$ diff core/modules/forum/config/optional/views.view.forum_forums.yml core/modules/forum/config/views.view.forum_forums.yml -s
Files core/modules/forum/config/optional/views.view.forum_forums.yml and core/modules/forum/config/views.view.forum_forums.yml are identical

@faline, we still need to get the view re-done & re-exported for this to work, setting this to Needs work.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.0-alpha1 will be released the week of January 30, 2017, which means new developments and disruptive changes should now be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

mohit_aghera’s picture

Status: Needs work » Needs review
StatusFileSize
new23.23 KB
new20.2 KB

I tried to reimplement view again for 8.4.x branch.
I have attached implementation for view. I have noticed following things that needs some work on below topics, and need some help in those.

It causes some issues in displaying latest comment date.
View doesn't displays results when we don't have any containers around forum.

Status: Needs review » Needs work

The last submitted patch, 20: try_and_build_forum-2207263-20.patch, failed testing.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.0-alpha1 will be released the week of July 31, 2017, which means new developments and disruptive changes should now be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.0-alpha1 will be released the week of January 17, 2018, which means new developments and disruptive changes should now be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

dillix’s picture

aaronmchale’s picture

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

vsujeetkumar’s picture

Status: Needs work » Needs review
StatusFileSize
new829 bytes
new23.01 KB

Patch created after test fixed, Please review.

Status: Needs review » Needs work

The last submitted patch, 29: 2207263_29.patch, failed testing. View results

vsujeetkumar’s picture

Status: Needs work » Needs review
StatusFileSize
new589 bytes
new23.01 KB

More test fixed, Please review.

Status: Needs review » Needs work

The last submitted patch, 31: 2207263_31.patch, failed testing. View results

vsujeetkumar’s picture

Status: Needs work » Needs review
StatusFileSize
new1.06 KB
new22.89 KB

More test fixing, Please review.

Status: Needs review » Needs work

The last submitted patch, 33: 2207263_33.patch, failed testing. View results

vsujeetkumar’s picture

Status: Needs work » Needs review
StatusFileSize
new563 bytes
new23.01 KB

Try to fix tests, Please review.

Status: Needs review » Needs work

The last submitted patch, 35: 2207263_35.patch, failed testing. View results

manuel garcia’s picture

Status: Needs work » Needs review
StatusFileSize
new2.35 KB
new24.19 KB

Thanks for working on this @vsujeetkumar, I thought I'd give it another push:

+++ b/core/modules/forum/config/optional/views.view.forum_forums.yml
@@ -0,0 +1,801 @@
+uuid: d6783039-0fcb-4a96-99a5-796b62a626df

uuid should be omitted, since this is a default view.

Updating Upgrade7Test and Upgrade6Test view counts since we are adding a new view here.

I also imported, saved and re-exported the view to get the correct configuration which should also get \Drupal\KernelTests\Config\DefaultConfigTest passing.

Status: Needs review » Needs work

The last submitted patch, 37: 2207263-37.patch, failed testing. View results

manuel garcia’s picture

Status: Needs work » Needs review
StatusFileSize
new586 bytes
new24.42 KB

Let's try that again.

lendude’s picture

I haven't even applied the patch yet, so these are just general observations.

We need screenshot of how the new view looks, to compare to the non-view situation. Also some form of test coverage would be nice, but not sure how that should look. Should all functional tests pass when switching to the view-version? How do we want to be sure we are not losing any functionality?

Also, I think the scope of the issue is a little too big. 'create /forum and /forum/x' should probably be split up into two issues, or is there a hard reason that these need to be moved over at the same time?

larowlan’s picture

'create /forum and /forum/x' should probably be split up into two issues, or is there a hard reason that these need to be moved over at the same time

No, not really, if there's no economy-of-scale

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

dillix’s picture

Should we change project from 'Drupal Core' to 'Forum' since Forum has splitted from core?

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

needs-review-queue-bot’s picture

Status: Needs review » Needs work
StatusFileSize
new144 bytes

The Needs Review Queue Bot tested this issue. It either no longer applies to Drupal core, or fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".

Apart from a re-roll or rebase, this issue may need more work to address feedback in the issue or MR comments. To progress an issue, incorporate this feedback as part of the process of updating the issue. This helps other contributors to know what is outstanding.

Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

quietone’s picture

Status: Needs work » Postponed

Forum is approved for removal. See #1898812: [policy] Deprecate forum module for removal in Drupal 11

This is now Postponed. The status is set according to two policies. The Remove a core extension and move it to a contributed project and the Extensions approved for removal policies.

It will be moved to the contributed extension once the Drupal 11 branch is open.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

quietone’s picture

Project: Drupal core » Forum
Version: 11.x-dev » 1.0.1
Component: forum.module » Code
Status: Postponed » Needs work
larowlan’s picture

Version: 1.0.1 » 2.x-dev
Category: Task » Feature request
quietone’s picture

And no longer a child of the core issue.

solideogloria’s picture

Things to fix (work in progress):

  1. The view does not show any results if the forums do not have any containers as parents. The fix: Containers are not required, so the Parent view relationship should not be required.
  2. It shows unpublished forums. The fix: Add a filter to only include published terms.
  3. Last post date is shown as an integer.
  4. Forum description HTML is not rendered if the view is aggregated, which it is. It's displayed as plain text, showing the HTML tags. The fix: Add "format" as an additional "group column" in the field's aggregation settings.
solideogloria’s picture

None of the existing patches are against the contrib module.

solideogloria’s picture

I added patch #39 to the MR, then made some initial fixes (fixing #1, 2, and 4 in my earlier comment) and re-exported config.