Problem/Motivation

The title says it.

This is part of #1823450: [Meta] Convert core listings to Views

From xjm's comment in #1823450-5: [Meta] Convert core listings to Views:
Would probably need forum data integration for {forum_index} to avoid potential performance regressions

Proposed resolution

Convert "Active forum topics" block to a View

Remaining tasks

User interface changes

Should be none.

Before (from #42)

After (from #68)

Note also from @webchick in #26:
this also "... actually fixes a bug with the old block where it lies to you about the existence of more forum topics"

Accessibility Improvements

  • ?

API changes

None?

CommentFileSizeAuthor
#186 interdiff-2020387-176-184.txt25.63 KBBhanu951
#176 2020387-176.patch26.26 KBsnehalgaikwad
#174 2020387-174.patch17.91 KBsnehalgaikwad
#173 Screenshot 2020-07-13 at 11.20.20 PM.png154.82 KBsamiullah
#172 2020387-172.patch25.36 KBHardik_Patel_12
#171 Screen Shot 2020-05-13 at 12.43.53.png30.43 KBRkumar
#171 Screen Shot 2020-05-13 at 12.43.59.png31.7 KBRkumar
#169 interdiff_167-169.txt1.14 KBvsujeetkumar
#169 2020387_169.patch26.86 KBvsujeetkumar
#167 interdiff-2020387-164-167.txt368 bytesmartin107
#167 2020387-167.patch26.28 KBmartin107
#164 2020387-164.patch25.92 KBshaktik
#164 interdiff_162-164.txt17.38 KBshaktik
#162 form-views-2020387-162.patch16.11 KBshaktik
#158 fixed-test-case-issues-2020387-158.patch19.89 KBshaktik
#157 Screen Shot 2020-04-24 at 14.18.30.png99.2 KBshaktik
#155 2020387-155.patch26.23 KBshaktik
#153 Screen Shot 2020-04-23 at 14.28.41.png56.54 KBshaktik
#150 2020387_150.patch26.23 KBvsujeetkumar
#150 interdiff_148-150.txt288 bytesvsujeetkumar
#148 interdiff_146-148.txt751 bytesvsujeetkumar
#148 2020387_148.patch25.82 KBvsujeetkumar
#146 2020387_146.patch25.9 KBvsujeetkumar
#146 interdiff_144-146.txt1.25 KBvsujeetkumar
#144 2020387_144.patch25.92 KBvsujeetkumar
#135 2020387-135.patch25.95 KBjofitz
#135 interdiff-133-135.txt9.29 KBjofitz
#133 2020387-133.patch16.66 KBjofitz
#133 interdiff-131-133.txt622 bytesjofitz
#131 2020387-131.patch16.82 KBjofitz
#119 2020387-119.patch17.51 KBlokapujya
#115 2020387-115.patch16.88 KBlokapujya
#110 AfterActiveForumViewPatch.png56.62 KBmgifford
#110 BeforeActiveForumViewPatch.png52.51 KBmgifford
#109 forum-2020387-109.patch17.4 KBoadaeh
#107 forum-2020387-107.patch17.4 KBoadaeh
#103 forum-2020387-103.patch17.41 KBAntti J. Salminen
#96 forum-2020387-96.patch17.37 KBAntti J. Salminen
#92 forum-2020387-92.patch17.34 KBAntti J. Salminen
#92 interdiff-2020387-85-92.txt2.13 KBAntti J. Salminen
#85 forum-2020387-85.patch18.56 KBdawehner
#85 interdiff.txt2.91 KBdawehner
#84 forum-2020387-83.patch17.58 KBAntti J. Salminen
#82 forum-2020387-82.patch16.87 KBAntti J. Salminen
#81 forum-2020387-81.patch16.29 KBAntti J. Salminen
#72 interdiff-2020387-63-72.txt550 bytesYesCT
#72 forum-2020387-72.patch16.49 KBYesCT
#69 Screenshot 2014-05-18 17.21.43.png26.28 KBlarowlan
#68 Hot_Topic___d8_dev.png93.97 KBjoelpittet
#63 interdiff.txt2.34 KBdawehner
#63 forum-2020387-63.patch16.49 KBdawehner
#58 forum-block-2020387-58.patch16.7 KBoadaeh
#52 forum-block.52.patch16.62 KBlarowlan
#52 interdiff.txt2.58 KBlarowlan
#50 forum-block.50.patch16.62 KBlarowlan
#50 interdiff.txt7.28 KBlarowlan
#46 Screenshot 2014-02-11 19.32.03.png36.09 KBlarowlan
#46 forum-block.46.patch16.44 KBlarowlan
#46 interdiff.txt770 byteslarowlan
#42 Screenshot 2014-01-08 07.49.25.png15.14 KBlarowlan
#42 Screenshot 2014-01-08 07.49.18.png22.45 KBlarowlan
#39 2020387-39-views-forum-blocks.patch15.87 KBmr.baileys
#34 interdiff.txt650 bytesmr.baileys
#34 2020387-34-views-forum-blocks.patch16.63 KBmr.baileys
#26 Screen Shot 2013-12-06 at 2.55.52 PM.png27.55 KBwebchick
#21 vdc-2020387.patch16.63 KBdawehner
#20 2020387-20-views-active-forum-listing.patch14.97 KBmr.baileys
#18 2020387-18-views-active-forum-topics-listing.patch8.8 KBmr.baileys
#15 views-forum-blocks-2020387-15.patch13.4 KBoadaeh
#11 new_active_topic_block.png49.35 KBAndi-D
#11 new_blocks.png16.18 KBAndi-D
#11 old_blocks.png17.32 KBAndi-D
#11 old_add_active_topic_block.png46.98 KBAndi-D
#11 old_add_new_topic_block.png46.73 KBAndi-D
#10 drupal-issue-2020387_1.patch13.41 KBAndi-D
#6 interdiff-2020387-3-5.txt3.74 KBYesCT
#5 drupal-issue-2020387.patch12.48 KBKars-T
#3 drupal-issue-2020387.patch9.25 KBAndi-D

Issue fork drupal-2020387

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:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

oadaeh’s picture

Issue tags: +VDC

Forgot the tag.

Andi-D’s picture

Assigned: Unassigned » Andi-D

I am here in Dublin and i will make this issues

Andi-D’s picture

Assigned: Andi-D » Unassigned
Status: Active » Needs review
FileSize
9.25 KB

I created a new view with two block displays:

New forum topics

  • 5 Topics
  • Sort by Post Date Desc


Active forum topics

  • 5 Topics
  • Sort by last comment date, Desc

The view selects following fields:

  • Forum Nid (exlude from display)
  • Forum Title

I selecting the Nid because i need to rewrite the link target as views doesnt provide any automatic option to to this.

The patch also remove the old block files

  • ActiveForumBlock.php
  • NewForumBlock.php

And remove the following function:

/**
 * Render API callback: Lists nodes based on the element's #query property.
 *
 * This function can be used as a #pre_render callback.
 *
 * @see \Drupal\forum\Plugin\block\block\NewTopicsBlock::build()
 * @see \Drupal\forum\Plugin\block\block\ActiveTopicsBlock::build()
 */
function forum_block_view_pre_render($elements) {
  $result = $elements['#query']->execute();
  if ($node_title_list = node_title_list($result)) {
    $elements['forum_list'] = $node_title_list;
    $elements['forum_more'] = array('#theme' => 'more_link', '#url' => 'forum', '#title' => t('Read the latest forum topics.'));
  }
  return $elements;
}

Status: Needs review » Needs work

The last submitted patch, drupal-issue-2020387.patch, failed testing.

Kars-T’s picture

Status: Needs work » Needs review
FileSize
12.48 KB

I changed the patch:

  • It now uses the correct name of the block. It is "views_block:forum_topic_lists-block_2".
  • dawehner did tell us not to change "block_2" and leave it as it is.
  • I removed the test about "Display 2 items" because this setting is no longer inside of the block configuration but a global views setting. And this should be covered with a test elsewhere. So imho we don't need to check this anymore.
  • "More" link is now uppercase as the test demanded.
YesCT’s picture

FileSize
3.74 KB

here is the interdiff. :)

YesCT’s picture

Issue tags: +Needs screenshots

let's do a before and after screenshot too.

Status: Needs review » Needs work

The last submitted patch, drupal-issue-2020387.patch, failed testing.

dawehner’s picture

Thanks for working on the patch.

So it seems to be that if the items per page override is in, this functionality is not part of the active forum topic view, so it should not be tested on here. That is fine to remove for now.

Andi-D’s picture

FileSize
13.41 KB

Create new version of the patch:

  • Fix the Problems in the last test and change in ForumNodeAccessTest the block name to the new one
  • Change the Display Style to html list, because the old one was a html list
Andi-D’s picture

Here the New Version after the patch

New Version off add active topic block, add new topic blocks looks the same

new version add active topic block

New Version off the new Blocks

New Version off the new Blocks

Here the old Versions before the patch:

Old add active topic block

Old Version off add active topic block

old add new topic block

old version off add new topic

old blocks

old blocks

Andi-D’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, drupal-issue-2020387_1.patch, failed testing.

dawehner’s picture

We can now override the items per page, let's get this issue up to speed again.

oadaeh’s picture

Status: Needs work » Needs review
Issue tags: -Needs screenshots
FileSize
13.4 KB

Updated patch.

I think the test is going to fail again, but I couldn't figure out where to look to fix it.

Status: Needs review » Needs work

The last submitted patch, views-forum-blocks-2020387-15.patch, failed testing.

mr.baileys’s picture

Assigned: Unassigned » mr.baileys

Assigning to myself to see if I can resolve the test failure during the DrupalCon Prague Code Sprint.

mr.baileys’s picture

Status: Needs work » Needs review
FileSize
8.8 KB

Ok, after some troubleshooting, I found out that the tests fail simply because the views module is not included during test set up. However...

After adding the Views module as a required module for the test, the "Forum private node access" test fails on one of the next statements. This is caused by the fact that, since D8, when querying with the "node_access"-tag against a base table <> {node}, you need to explicitly define the base table using $query->addMetadata('base_table', 'forum_index') (See http://drpual.org/node/1885420 for a discussion)

Unfortunately, hook_views_data currently only allows you to specify the query tag, not the query metadata. I have opened a new issue for this #2099511: Change notice: Need support for adding metadata in hook_views_data()..

Attached is a patch that includes the patch for that issue to prove tests pass, but this issue is blocked by #2099511: Change notice: Need support for adding metadata in hook_views_data().. Setting to NR for the testbot.

Status: Needs review » Needs work

The last submitted patch, 2020387-18-views-active-forum-topics-listing.patch, failed testing.

mr.baileys’s picture

Status: Needs work » Needs review
FileSize
14.97 KB

Views yml file was missing in previous patch.

dawehner’s picture

Issue summary: View changes
Status: Needs review » Reviewed & tested by the community
FileSize
16.63 KB

This was basically a straight rerole, so let's get it to RTBC

Xano’s picture

21: vdc-2020387.patch queued for re-testing.

webchick’s picture

Sorry, I tried really hard to get to this one tonight but I am completely out of steam. :( But please check the in-depth review at #2020399-54: Convert "Who's online" block to a View because some of that might apply here, too.

Will try and bang this out tomorrow.

webchick’s picture

Sorry, cancel that. #2020399-58: Convert "Who's online" block to a View Patch still applies though, so hopefully one of the other core maintainers can get to it.

mr.baileys’s picture

Assigned: mr.baileys » Unassigned
webchick’s picture

Status: Reviewed & tested by the community » Fixed
Issue tags: +alpha target
FileSize
27.55 KB

Ok, dawehner and I subsequently hugged and made up, and now that #1957276: Let users set the block instance title for Views blocks in the Block UI is in, there's no reason not to go all out on block conversion patches anymore. YEAH.

I'd love for all of these block conversions to make it into the next alpha, so tagging.

This one is funny because in addition to removing a bunch of crappy custom code, it actually fixes a bug with the old block where it lies to you about the existence of more forum topics:

Forum block says there are more when there are not

Committed and pushed to 8.x. Thanks!

tim.plunkett’s picture

Title: Convert "Active forum topics" block to a View » HEAD BROKEN: Convert "Active forum topics" block to a View
Category: Task » Bug report
Priority: Normal » Critical
Status: Fixed » Reviewed & tested by the community

Not sure what broke this, but it hadn't been retested since mid-November.

git revert d166be3

alexpott’s picture

Priority: Critical » Normal
Status: Reviewed & tested by the community » Needs work

Reverted the earlier commit with 5aab968 and pushed to 8.x.

alexpott’s picture

Title: HEAD BROKEN: Convert "Active forum topics" block to a View » Convert "Active forum topics" block to a View
Category: Bug report » Task
alexpott’s picture

21: vdc-2020387.patch queued for re-testing.

The last submitted patch, 21: vdc-2020387.patch, failed testing.

webchick’s picture

Uh oh. :( Sorry, folks! :(

webchick’s picture

In fairness, who would've guessed anyone did anything with Forum module in 2 weeks? :P~

mr.baileys’s picture

Status: Needs work » Postponed
FileSize
16.63 KB
650 bytes

Attached is an updated patch which resolves the test failures. However, as indicated in #18, this patch contains a hunk from #2099511: Change notice: Need support for adding metadata in hook_views_data()., so is blocked until that lands.

sun’s picture

One more reason for why HEAD was broken is most likely this:

+++ b/core/modules/views/lib/Drupal/views/Plugin/views/query/Sql.php

+        foreach ($base_table_data['table']['base']['query metadata'] as $key => $value)
+        $query->addMetaData($key, $value);
+        $count_query->addMetaData($key, $value);

→ The foreach lacks a block; the $count_query line only adds meta data for the last $key and $value of the loop.

dawehner’s picture

→ The foreach lacks a block; the $count_query line only adds meta data for the last $key and $value of the loop.

Yeah I had the same kind of trouble while writing tests in the other issue.

moshe weitzman’s picture

The patches to date delete the caching that this block implements. We should enable time based results caching for this block for a short duration. I'd say 5-10min. No need for output caching.

ianthomas_uk’s picture

Status: Postponed » Needs work

The issue this was postponed on has been committed.

mr.baileys’s picture

Status: Needs work » Needs review
FileSize
15.87 KB

New patch

dawehner’s picture

I try to figure out why we don't use time based output caching,
beside from that this looks perfect!

moshe weitzman’s picture

I suggested results based cache just to more closely mimic what we had before. I'd be fine with output cache as well.

larowlan’s picture

+++ b/core/modules/forum/forum.module
@@ -555,23 +555,6 @@ function forum_form_node_form_alter(&$form, &$form_state, $form_id) {
-    $elements['forum_more'] = array('#theme' => 'more_link', '#url' => 'forum', '#title' => t('Read the latest forum topics.'));

The more link in the views output doesn't contain a title attribute - can that be added or is that something views doesn't support? If not, I guess we can live without it, but it would be a worthwhile addition for other views too.

Less custom code++
More customisability++

Shedding the 'too specific to be of any use, too rigid to customise' tag that has burdened forum since forever.

Screenshots of title issue
before
does my butt look big?

after
does my butt look big?

dawehner’s picture

I suggested results based cache just to more closely mimic what we had before. I'd be fine with output cache as well.

Ah okay, I am fine with keeping that for now and think about more in a follow up.

The more link in the views output doesn't contain a title attribute - can that be added or is that something views doesn't support? If not, I guess we can live without it, but it would be a worthwhile addition for other views too.

Don't we kind of need it for accessibility as well?

larowlan’s picture

We either have

<a href="/forum">More<span class="invisible"> forum topics</span></a>

Or the title.
If we can do the markup above with views, then we're fine I think.

dawehner’s picture

As said on IRC, it feels like an actual usecase for a template.

larowlan’s picture

Adds some markup to help screen-readers.
If this approach is acceptable, I consider this RTBC
Screenshot of markup/output

Status: Needs review » Needs work

The last submitted patch, 46: forum-block.46.patch, failed testing.

larowlan’s picture

46: forum-block.46.patch queued for re-testing.

The last submitted patch, 46: forum-block.46.patch, failed testing.

larowlan’s picture

Status: Needs work » Needs review
FileSize
7.28 KB
16.62 KB

schema tests++

Status: Needs review » Needs work

The last submitted patch, 50: forum-block.50.patch, failed testing.

larowlan’s picture

Status: Needs work » Needs review
FileSize
2.58 KB
16.62 KB

and the other display

Status: Needs review » Needs work

The last submitted patch, 52: forum-block.52.patch, failed testing.

mgifford’s picture

This looks like it will be an improvement for accessibility! Great job.

joelpittet’s picture

+++ b/core/modules/forum/forum.module
@@ -624,6 +607,17 @@ function forum_theme_suggestions_forums(array $variables) {
+    $variables['more']['#link_text'] .= '<span class="visually-hidden"> ' . filter_xss_admin($view->getTitle()) .  '</span>';

I'd prefer if there was no markup in PHP. Though right now we don't have filter_xss_admin as a filter(easily added though). This to me looks like an opportunity to use twig blocks. http://twig.sensiolabs.org/doc/tags/block.html We haven't used them at all in core yet but this seems like a fit if we can get them to work. Duplicating views-view.html.twig is asking for trouble, that's why I suggest this. Also would need a suggestion hook potentially for the view id, if that doesn't already exist (thought d7 had these suggestions I don't know if they carried over).

joelpittet’s picture

Issue tags: +Twig

@Cottser, I'll need you to help vet my crazy ideas:) Something to discuss at the weekly.

xjm’s picture

Issue tags: +beta target
oadaeh’s picture

Status: Needs work » Needs review
FileSize
16.7 KB

Here's is a re-roll of @larowlan's patch, updated to the current state of core. I also removed the caching in the views, as that was causing my local tests to fail.

Status: Needs review » Needs work

The last submitted patch, 58: forum-block-2020387-58.patch, failed testing.

oadaeh’s picture

Status: Needs work » Needs review

58: forum-block-2020387-58.patch queued for re-testing.

The last submitted patch, 34: 2020387-34-views-forum-blocks.patch, failed testing.

Status: Needs review » Needs work

The last submitted patch, 58: forum-block-2020387-58.patch, failed testing.

dawehner’s picture

Status: Needs work » Needs review
FileSize
16.49 KB
2.34 KB

Fixed the failures.

joelpittet’s picture

+++ b/core/modules/forum/config/install/views.view.forum_topic_lists.yml
@@ -0,0 +1,235 @@
+  block_1:
...
+    id: block_1
...
+  block_2:
...
+    id: block_2

+++ b/core/modules/forum/lib/Drupal/forum/Tests/ForumBlockTest.php
@@ -116,7 +99,7 @@ public function testActiveForumTopicsBlock() {
+    $block = $this->drupalPlaceBlock('views_block:forum_topic_lists-block_1');

+++ b/core/modules/forum/lib/Drupal/forum/Tests/ForumNodeAccessTest.php
@@ -72,8 +72,8 @@ function testForumNodeAccess() {
+    $this->drupalPlaceBlock('views_block:forum_topic_lists-block_1');
+    $this->drupalPlaceBlock('views_block:forum_topic_lists-block_2');

If this goes green, can these blocks get names like block_active_topics, block_new_topics. Similar question was asked previously #5.

I'll gladdly roll it in if you don't mind @dawehner? Thanks for the fixes, nevertheless:)

dawehner’s picture

If this goes green, can these blocks get names like block_active_topics, block_new_topics. Similar question was asked previously #5.

I won't do that because I hate abysmally to rename the generated machine names but people disagree with that.

joelpittet’s picture

@dawehner that's understandable... then would you be in favour if I opened up an issue to have the view's blocks create better generated machine names?

dawehner’s picture

@dawehner that's understandable... then would you be in favour if I opened up an issue to have the view's blocks create better generated machine names?

Well, I am not sure whether it is worth to fight here, not sure whether there is anyone else agreeing here.

joelpittet’s picture

Status: Needs review » Reviewed & tested by the community
FileSize
93.97 KB

We can see if it has any interest, otherwise nice work getting this green:)
#2269711: Generate views' display ids by their display_title.

Looks and great again :)

I'm assuming the tests removed from #5 are still fine and the ranges from 2-20 changed to 5, 10, 20, 40 are still cool with everybody.

larowlan’s picture

What's the deal with the more link underline?

YesCT’s picture

Issue summary: View changes

put screenshots in the issue summary.

does this need profiling? or a follow-up for looking into that?

YesCT’s picture

YesCT’s picture

Status: Reviewed & tested by the community » Needs review
FileSize
16.49 KB
550 bytes

looking at the screenshots, seems a typo capitalizing Topics in "New forum Topics". fixed that.

dawehner’s picture

Issue tags: +needs profiling
YesCT’s picture

Issue summary: View changes

adding profile contributor task doc to the issue summary
https://drupal.org/contributor-tasks/profiling

joelpittet’s picture

Status: Needs review » Needs work

Re #69 seems that because the class of .more-link class is on the link itself and not the wrapping div of the link. Nice sport @larowlan

Also that may have some implications on this issue: #2031301: Replace theme_more_link() and replace with #type 'more_link'

I'm thinking that may need some CSS tweaks as I do prefer the one-less-div but I'll see if others agree?

mgifford’s picture

@larowlan that's definitely something we missed when adding it here #890362: Links should not be indicated by color only

dawehner’s picture

Status: Needs work » Reviewed & tested by the community

But well, this is not a problem which is related at all with the patch.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 72: forum-2020387-72.patch, failed testing.

star-szr’s picture

Issue tags: +Needs reroll

This needs a reroll, maybe mostly for PSR-4? https://groups.drupal.org/node/424758

Antti J. Salminen’s picture

Assigned: Unassigned » Antti J. Salminen

Looking at where this stands.

Antti J. Salminen’s picture

Assigned: Antti J. Salminen » Unassigned
FileSize
16.29 KB

Reroll with PSR-4. There is a remaining issue with the markup for the more link getting double escaped that I didn't quite have time to fix yet.

Antti J. Salminen’s picture

Status: Needs work » Needs review
FileSize
16.87 KB

This patch introduces a template override for the more link and goes back to using the title attribute. Is this an acceptable way or is there a better one? It's pretty similar to what's being done with the system module's branding block.

Status: Needs review » Needs work

The last submitted patch, 82: forum-2020387-82.patch, failed testing.

Antti J. Salminen’s picture

Status: Needs work » Needs review
FileSize
17.58 KB

Fixing the schema issue with slave being renamed to replica and adding the template that was missing from last patch.

dawehner’s picture

Status: Needs review » Reviewed & tested by the community
FileSize
2.91 KB
18.56 KB

Decided to drop the need for the additional template and moved the function along. But this is just a small detail.

star-szr’s picture

Status: Reviewed & tested by the community » Needs review
Issue tags: -Needs reroll

What about the profiling?

+++ b/core/modules/views/views.module
@@ -16,6 +16,7 @@
+use Drupal\Core\Template\Attribute;

@@ -268,6 +269,13 @@ function views_theme_suggestions_node_alter(array &$suggestions, array $variable
+ * Implements MODULE_preprocess_HOOK() for views-more templates.
+ */
+function views_preprocess_views_more(&$variables) {
+  $variables['attributes'] = new Attribute();
+}
+
+/**

I don't think this is needed, the Attribute object is initialized in _theme() for attributes, content_attributes, title_attributes.

But maybe I'm missing something :)

star-szr’s picture

Really like the use of addClass btw.

dawehner’s picture

@Antti J. Salminen
Please feel free to fix the reviews. Just wanted to avoid explaining my idea and just implemented it.

Status: Needs review » Needs work

The last submitted patch, 85: forum-2020387-85.patch, failed testing.

The last submitted patch, 81: forum-2020387-81.patch, failed testing.

Antti J. Salminen’s picture

Assigned: Unassigned » Antti J. Salminen

@dawehner Thanks! I'll do that and try to take it forward from that.

Antti J. Salminen’s picture

Assigned: Antti J. Salminen » Unassigned
Status: Needs work » Needs review
FileSize
2.13 KB
17.34 KB

Ok, this should be working now. At least profiling still remains.

dawehner queued 92: forum-2020387-92.patch for re-testing.

Status: Needs review » Needs work

The last submitted patch, 92: forum-2020387-92.patch, failed testing.

dawehner’s picture

Issue tags: +Needs reroll

so ....

Antti J. Salminen’s picture

Status: Needs work » Needs review
FileSize
17.37 KB

This should be a very straightforward reroll with no real changes, hopefully tests pass again after it.

dawehner’s picture

@Cottser
Well, profiling would be obviously a little bit unfair, but let's see what happens.

star-szr’s picture

Issue tags: -Needs reroll

@dawehner just saying that because it's tagged. I'm fine either way :)

dawehner’s picture

Yeah I guess we cannot not do it.

Antti J. Salminen’s picture

Here's an attempt at profiling the "Active forum topics block". This is with 50 topics containing 9 comments each for a total of 500 posts. Current is 8.0.x. Done as described in the contributor task. Only change to default config was to enable the APC Classloader. I suppose the "New forum topics" block also needs to be tested.

=== current..current compared (54233b929147b..54233d77d84ce):

ct  : 65,214|65,214|0|0.0%
wt  : 2,812,300|2,819,245|6,945|0.2%
cpu : 1,892,118|1,880,117|-12,001|-0.6%
mu  : 41,747,688|41,747,688|0|0.0%
pmu : 41,789,696|41,789,696|0|0.0%

=== current..forum-2020387-96 compared (54233b929147b..54233f7f69a7d):

ct  : 65,214|83,445|18,231|28.0%
wt  : 2,812,300|2,936,762|124,462|4.4%
cpu : 1,892,118|1,992,124|100,006|5.3%
mu  : 41,747,688|43,671,232|1,923,544|4.6%
pmu : 41,789,696|43,714,616|1,924,920|4.6%

---
ct = function calls, wt = wall time, cpu = cpu time used, mu = memory usage, pmu = peak memory usage
dawehner’s picture

@Antti J. Salminen
Just to be sure, did you checked that the caches are warmed like finding all the views plugins (just curious).

Antti J. Salminen’s picture

@dawehner
I believe they should be. To me the profiling that was done on the recent comments block looks somewhat similar (https://www.drupal.org/node/1938062#comment-7576867). I think most of the extra time is spent in rendering the view.

I put the diff available online in the xhprof UI:
http://xhprof.facingworlds.com/?sort=ct&run1=54233b929147b&run2=54233f7f...

Antti J. Salminen’s picture

FileSize
17.41 KB

Rerolling because one of the files this deletes changed.

dawehner queued 103: forum-2020387-103.patch for re-testing.

larowlan’s picture

Issue tags: +Needs reroll
oadaeh’s picture

Assigned: Unassigned » oadaeh
oadaeh’s picture

Assigned: oadaeh » Unassigned
FileSize
17.4 KB

A simple re-roll with only changes to account for Drupal updates.

oadaeh’s picture

Issue tags: -Needs reroll
oadaeh’s picture

FileSize
17.4 KB

I found a bug in my previous patch.
This patch simply changes the content links from 'node/[nid]' to 'node/{{ nid }}'.

mgifford’s picture

Seems to apply fine. You can definitely see the Active Forum Topics in the list of views.

There's a slightly different display of the block /admin/structure/block before & after:
before the patch

after the patch

This may not matter, but wanted to point it out. What manual testing should we do before this is marked RTBC? I really don't use forums much.

jibran queued 109: forum-2020387-109.patch for re-testing.

Status: Needs review » Needs work

The last submitted patch, 109: forum-2020387-109.patch, failed testing.

oadaeh’s picture

Issue tags: +Needs reroll
mgifford’s picture

Have to address the missing views-more.html.twig #2036195: Remove views-more.html.twig and replace with #type link render arrays

Also have to look into why core/modules/forum/src/Plugin/Block/ForumBlockBase.php was rejected when applying the patch.

lokapujya’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll
FileSize
16.88 KB

I think both of those files should be deleted.

Status: Needs review » Needs work

The last submitted patch, 115: 2020387-115.patch, failed testing.

xjm’s picture

Issue tags: -alpha target, -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.

This change is disruptive and so should be targeted for 8.2.x at this point.

lokapujya’s picture

Version: 8.0.x-dev » 8.2.x-dev
lokapujya’s picture

Status: Needs work » Needs review
FileSize
17.51 KB

reroll and re-export of the view.

Status: Needs review » Needs work

The last submitted patch, 119: 2020387-119.patch, failed testing.

lokapujya’s picture

Are these schema errors and unmet dependencies a problem with the view? Might need to be rebuilt or maybe go back to the last working one and run the Drupal updates.

  • alexpott committed 5aab968 on 8.3.x
    Revert "Issue #2020387 by mr.baileys, Andi-D, dawehner, oadaeh, YesCT,...
  • webchick committed d166be3 on 8.3.x
    Issue #2020387 by mr.baileys, Andi-D, dawehner, oadaeh, YesCT, Kars-T:...

  • alexpott committed 5aab968 on 8.3.x
    Revert "Issue #2020387 by mr.baileys, Andi-D, dawehner, oadaeh, YesCT,...
  • webchick committed d166be3 on 8.3.x
    Issue #2020387 by mr.baileys, Andi-D, dawehner, oadaeh, YesCT, Kars-T:...

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.

  • alexpott committed 5aab968 on 8.4.x
    Revert "Issue #2020387 by mr.baileys, Andi-D, dawehner, oadaeh, YesCT,...
  • webchick committed d166be3 on 8.4.x
    Issue #2020387 by mr.baileys, Andi-D, dawehner, oadaeh, YesCT, Kars-T:...

  • alexpott committed 5aab968 on 8.4.x
    Revert "Issue #2020387 by mr.baileys, Andi-D, dawehner, oadaeh, YesCT,...
  • webchick committed d166be3 on 8.4.x
    Issue #2020387 by mr.baileys, Andi-D, dawehner, oadaeh, YesCT, Kars-T:...

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.

jibran’s picture

Issue tags: +Needs reroll

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.

lokapujya’s picture

Issue summary: View changes
jofitz’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll
FileSize
16.82 KB

Re-rolled.

Status: Needs review » Needs work

The last submitted patch, 131: 2020387-131.patch, failed testing. View results

jofitz’s picture

Status: Needs work » Needs review
FileSize
622 bytes
16.66 KB

Patch in #131 no longer applies.

Minor correction in schema.

Status: Needs review » Needs work

The last submitted patch, 133: 2020387-133.patch, failed testing. View results

jofitz’s picture

Status: Needs work » Needs review
FileSize
9.29 KB
25.95 KB

Resolve many of the test failures.

Status: Needs review » Needs work

The last submitted patch, 135: 2020387-135.patch, failed testing. View results

jofitz’s picture

I think I've taken this as far as I can. Does someone else want to take over? Otherwise I'm happy to accept advice/guidance.

lokapujya’s picture

I recommend rebuilding the view.

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.

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.

geek-merlin’s picture

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
FileSize
25.92 KB

Patch created for 8.9.x-dev, Please review.

Status: Needs review » Needs work

The last submitted patch, 144: 2020387_144.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

vsujeetkumar’s picture

Status: Needs work » Needs review
FileSize
1.25 KB
25.9 KB

More test fixes.

Status: Needs review » Needs work

The last submitted patch, 146: 2020387_146.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

vsujeetkumar’s picture

Status: Needs work » Needs review
FileSize
25.82 KB
751 bytes

Test Fixes.

Status: Needs review » Needs work

The last submitted patch, 148: 2020387_148.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

shaktik’s picture

Assigned: Unassigned » shaktik
Status: Needs work » Needs review
shaktik’s picture

Assigned: shaktik » Unassigned

here is some failure test.

--

There was 1 failure:

1) Drupal\Tests\forum\Kernel\LegacyForumTest::testGetParents
Failed asserting that string matches format description.
--- Expected
+++ Actual
@@ @@
 @expectedDeprecation:
-%A  Drupal\forum\ForumManager::getParents() is deprecated in drupal:8.1.0 and is removed from drupal:9.0.0. Call loadAllParents() on taxonomy term storage directly. See https://www.drupal.org/node/3069599
+

ERRORS!
Tests: 37, Assertions: 123, Errors: 12, Failures: 1.

HTML output was generated
shaktik’s picture

Status: Needs review » Needs work
FileSize
56.54 KB
shaktik’s picture

Status: Needs work » Active
index fdd610aa26..e71591a58c 100644
--- a/core/modules/forum/tests/src/Kernel/LegacyForumTest.php
+++ b/core/modules/forum/tests/src/Kernel/LegacyForumTest.php
@@ -61,7 +61,7 @@ public function testGetParents() {
     ]);
     $subforum->save();

-    $legacy_parents = \Drupal::service('forum_manager')->getParents($subforum->id());
+    $legacy_parents = \Drupal::entityTypeManager()->getStorage('taxonomy_term')->loadAllParents($subforum->id());
     $parents = $this->termStorage->loadAllParents($subforum->id());
     $this->assertSame($parents, $legacy_parents);
   }
shaktik’s picture

Status: Needs review » Needs work

The last submitted patch, 155: 2020387-155.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

shaktik’s picture

Status: Needs work » Needs review
FileSize
99.2 KB

#155 Patch working fine also test case pass see screenshot.Active forum topics

shaktik’s picture

Status: Needs review » Needs work

The last submitted patch, 158: fixed-test-case-issues-2020387-158.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

shaktik’s picture

Status: Needs work » Needs review

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.

shaktik’s picture

Patch in #155 no longer applies d9, so created a new patch to support d9.

Status: Needs review » Needs work

The last submitted patch, 162: form-views-2020387-162.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

shaktik’s picture

More test case fixes.

shaktik’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 164: 2020387-164.patch, failed testing. View results

martin107’s picture

Status: Needs work » Needs review
FileSize
26.28 KB
368 bytes

These changes make 'view' a dependency of the forum module.

Status: Needs review » Needs work

The last submitted patch, 167: 2020387-167.patch, failed testing. View results

vsujeetkumar’s picture

Status: Needs work » Needs review
FileSize
26.86 KB
1.14 KB

Fixed More test, Please review.

martin107’s picture

vsujeetkumar++

thanks for debugging that -- changes look good.

Rkumar’s picture

Patch looks fine and now blocks are rendering through views.
Thanks for this contribution.

Hardik_Patel_12’s picture

Patch #169 failed to apply , so re-rolling the patch. Kindly review a patch.

samiullah’s picture

@hardik patel
I applie ur latest patch getting some hunks failed
refer screenshot

snehalgaikwad’s picture

Status: Needs review » Needs work

The last submitted patch, 174: 2020387-174.patch, failed testing. View results

snehalgaikwad’s picture

Status: Needs work » Needs review
FileSize
26.26 KB

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.

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.

nod_’s picture

Status: Needs review » Needs work

D10 version needed
At this time we need a D10.1.x patch or MR for this issue.

nod_’s picture

Issue tags: +Needs reroll
Bhanu951’s picture

Assigned: Unassigned » Bhanu951

Bhanu951’s picture

Assigned: Bhanu951 » Unassigned
Status: Needs work » Needs review
Issue tags: -Needs reroll
FileSize
25.63 KB

Re-Rolled patch 2020387-176.patch to 10.1.x .

quietone’s picture

Status: Needs review » 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.

Bhanu951’s picture

Should we move this issue to Forum Module Queue as decision is finalised ?