Problem/Motivation

  • To demonstrate the MVP for having Views in core, we need to convert at least one core listing to a view.
  • The "promoted" node listing at /node is a fairly straightforward listing with a few module-specific features, so it is a good test case
  • New Drupal users often want to know how to customize this listing anyway, so it is an easily discoverable place to add a View in core.

Proposed resolution

  • Convert the main /node listing to a View.

Remaining tasks

  • The next step is to add an upgrade path that enables Views for sites that have the node listing as their front page in Drupal 7. See #75 and #76.
  • Identify and create follow-up issues.

Blockers

Related issues

Followups

CommentFileSizeAuthor
#189 drupal-module_handler-1806334--fail.patch1.89 KBParisLiakos
#189 drupal-module_handler-1806334.patch1.25 KBParisLiakos
#168 drupal-1806334-168.patch36.22 KBdawehner
#168 interdiff.txt778 bytesdawehner
#167 drupal-1806334-167.patch36.23 KBParisLiakos
#167 interdiff.txt661 bytesParisLiakos
#160 drupal-1806334-159.patch35.58 KBParisLiakos
#160 interdiff.txt531 bytesParisLiakos
#157 debug.png263.43 KBYesCT
#153 drupal-1806334-153.patch35.58 KBdawehner
#136 overview.png43.01 KBBerdir
#136 functions.png145.67 KBBerdir
#136 xhprof.tar_.gz170 KBBerdir
#132 node.png99.37 KBdawehner
#132 xhprof-node.txt390.76 KBdawehner
#132 xhprof-views.txt508.22 KBdawehner
#126 interdiff.txt902 bytestim.plunkett
#126 vdc-1806334-126.patch35.52 KBtim.plunkett
#124 drupal-1806334-122.patch35.52 KBtim.plunkett
#122 drupal-1806334-122.patch35.52 KBdawehner
#121 interdiff.txt1.21 KBdawehner
#118 vdc-1806334-118.patch34.05 KBtim.plunkett
#118 interdiff.txt1.53 KBtim.plunkett
#116 interdiff.txt3.24 KBdawehner
#116 drupal-1806334-116.patch32.52 KBdawehner
#113 drupal-1806334-113.patch29.73 KBdawehner
#113 interdiff.txt2.53 KBdawehner
#111 drupal-1806334-111.patch30.16 KBdawehner
#107 node-frontpage-1806334-107.patch35.8 KBxjm
#104 drupal-1806334-104.patch36.43 KBdawehner
#87 views-1806334-87.patch36.22 KBxjm
#87 interdiff.txt3.98 KBxjm
#83 interdiff.txt943 bytesdawehner
#75 views-1806334-75.patch36.89 KBxjm
#75 interdiff.txt638 bytesxjm
#71 views-1806334-71.patch35.34 KBxjm
#68 call-chain.txt6.02 KBxjm
#68 views-backtrace.txt69.71 KBxjm
#64 views-1806334-64.patch30.83 KBxjm
#59 views-1806334-59.patch29.64 KBxjm
#57 views-1806334-57.patch26.17 KBxjm
#55 interdiff.txt11.07 KBdawehner
#55 drupal-1806334-55.patch26.17 KBdawehner
#53 interdiff.txt10.35 KBdawehner
#53 drupal-1806334-53.patch24.34 KBdawehner
#51 drupal-1806334-51.patch13.99 KBdawehner
#48 views-1806334-48.patch13.97 KBxjm
#35 vdc-1806334-35.patch19.53 KBtim.plunkett
#34 vdc-1806334-34.patch19.54 KBtim.plunkett
#33 vdc-1806334-33.patch20.44 KBxjm
#27 vdc-1806334-27.patch34 KBxjm
#25 vdc-1806334-25.patch34.31 KBtim.plunkett
#17 vdc-1806334-17.patch6.39 KBxjm
#17 interdiff-17.txt555 bytesxjm
#16 vdc-1806334-16.patch5.85 KBxjm
#11 vdc-1806334-11.patch16.2 KBdawehner
#6 vdc-1806334-6.patch6.64 KBdawehner
#6 interdiff.txt2.28 KBdawehner
#4 vdc-1806334-4.patch7.62 KBdawehner
#3 vdc-1806334-3.patch3.95 KBtim.plunkett
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

xjm’s picture

Issue tags: +VDC
xjm’s picture

Issue summary: View changes

Updated issue summary.

xjm’s picture

Issue summary: View changes

Updated issue summary.

xjm’s picture

Just saw that @dawehner posted this: #1806100: Replace node listing with a default view. We'll probably want to mark that one as a duplicate and move its patch here.

Should we move this and similar issues to the VDC sandbox queue?

tim.plunkett’s picture

Project: Drupal core » VDC
Version: 8.x-dev »
Component: other » Code
Status: Active » Needs review
FileSize
3.95 KB

Here's what I have so far, but it needs the empty behavior, which might have to be either a specific area plugin, or dumbed down. I think I'll write the plugin first, and then we can decide if we really want it to stay the same.

dawehner’s picture

FileSize
7.62 KB

So here is a start:

* Created a custom area handler which handles all this custom logic for the frontpage
* Fixed some other stuff which occurred on this node listing.

tim.plunkett’s picture

+++ b/core/modules/node/config/views.view.frontpage.ymlundefined
@@ -0,0 +1,169 @@
+          alter:
+            absolute: '0'
+            alter_text: '0'
+            ellipsis: '0'
+            html: '0'
+            make_link: '0'
+            strip_tags: '0'
+            trim: '0'
+            word_boundary: '0'

Are we going to export all this crap each time? :(

+++ b/core/modules/node/node.views.incundefined
@@ -678,6 +678,19 @@ function node_views_data() {
+function node_views_data_alter(&$data) {

Why isn't this just part of node_views_data()?

+++ b/core/modules/node/node.views.incundefined
@@ -678,6 +678,19 @@ function node_views_data() {
+      'id' => 'node_listing_empty'
+    )

Missing trailing commas

+++ b/core/modules/views/lib/Drupal/views/Plugin/views/area/AreaPluginBase.phpundefined
@@ -98,9 +98,7 @@ public function query() { }
-  function render($empty = FALSE) {
-    return '';
-  }
+  abstract function render($empty = FALSE);

Nice.

+++ b/core/modules/views/theme/views-view-rss.tpl.phpundefined
@@ -8,6 +8,7 @@
 <?php print "<?xml"; ?> version="1.0" encoding="utf-8" <?php print "?>"; ?>
+
 <rss version="2.0" xml:base="<?php print $link; ?>"<?php print $namespaces; ?>>
   <channel>

Uh?

dawehner’s picture

FileSize
2.28 KB
6.64 KB
Are we going to export all this crap each time? :(

Well we could go through each item and remove default values out before saving.
As i realized we will not get rid of defineOptions even with metadata, because jose
told me that default values are out of scope of the metadata issue.

I manually removed the fields from this export, because actually the view is not using any field
at all (the wizard just adds at least one field all the time, so the user don't get some validation errors).

Why isn't this just part of node_views_data()?

It is using the global area scope, but i agree it doesn't make sense to be on that as it is too specific.

The last change need for sure some explaination: If you print out <?xml you get also rss in the same line,
the new line fixes that, but i'm open to revert this change.

Missing trailing commas

This happens if you have written to many annotations :p

dawehner’s picture

Once the actual patch is ready i will remove the node module code and have a look whether the node tests still run fine.

dawehner’s picture

Project: VDC » Drupal core
Issue summary: View changes

Updated issue summary.

tim.plunkett’s picture

Issue summary: View changes

added blockers

xjm’s picture

Issue summary: View changes

Updated issue summary.

damiankloip’s picture

dawehner’s picture

Assigned: tim.plunkett » dawehner

Assignment for tonight.

damiankloip’s picture

As mentioned in VDC IRC (Just so it's in here too); We should remove the call to drupal_set_title (in favour of our new area handler) and also remove the code changes to AreaPluginBase.

damiankloip’s picture

Project: VDC » Drupal core
Issue summary: View changes

Updated issue summary.

dawehner’s picture

Project: Drupal core » VDC
FileSize
16.2 KB

Rerolled the patch against some current changes and started to realize that a lot of tests
actually rely on the existence of /node to check for example a link to the title.
Due to that all of these tests would require views to work.

Here is a beginning which let use views in two of the identified tests.

dawehner’s picture

Committed the current version so see what all is broken.

xjm’s picture

Assigned: dawehner » xjm

I'll work on fixing some of the additional tests.

xjm’s picture

So, a lot of the test failures are related trying to take over rss.xml rather than to /node itself. I think we should consider decoupling the feed from the initial node listing conversion, and leaving node_feed() in there for now.

xjm’s picture

Currently, the minimal profile also uses /node as the frontpage. I'm removing that configuration and letting it default to /user.

xjm’s picture

FileSize
5.85 KB

Here's a patch that puts rss.xml back.

xjm’s picture

FileSize
555 bytes
6.39 KB

And removing the node listing front page from minimal. Committed and sent to the bot.

xjm’s picture

menu_test.module is hugely coupled to the node page callback. Ugh.

xjm’s picture

A lot of the tests are also blocked on the standard profile issue.

xjm’s picture

And the outstanding simpletest/plugin manager bugs.

dawehner’s picture

Thanks for you work!

Based on our experience with the coupling of the tests with the /node page we might should create an issue in the core queue
to discuss a proper decoupling?

xjm’s picture

Yep, there's an issue somewhere already. Trying to find it...

xjm’s picture

Alright, I filed #1811016: [meta] Decouple tests from Node module. I'll submit some patches through that issue where appropriate rather than simply adding dependencies blindly.

tim.plunkett’s picture

In http://drupalcode.org/sandbox/tim.plunkett/1799554.git/commitdiff/6be6883 I worked to get more tests passing.
My theory was to not add Views as a dependency if possible, but to not spend hours decoupling.
Once We get this as close as possible, we can revisit each of those and re-evaluate.

Also, many of these fixes belong in the meta issue, but this is at least an easy way to identify them.

tim.plunkett’s picture

FileSize
34.31 KB

I'm done for now. The rest are standard profile tests or upgrade tests, I think.

Here's a patch of work to date

xjm’s picture

I'm still working on this. I've picked a few of @tim.plunkett's changes and my own and filed them as core issues. I'll post a new patch here when I'm done.

xjm’s picture

FileSize
34 KB

I've pushed several more fixes that are also filed as core issues. We can revert some commits once they're fixed in core.

I also cherry-picked the one that webchick committed across into the sandbox branch, and belatedly realized I shouldn't have because then it gets rolled into the patch. So before rolling the patch I did this locally:

git revert e2e87be

Notes for myself on tests to check since I'm getting tired and sloppy:

  • LocaleContentTest
  • LocalePathTest
  • MenuTest
  • NodeLoadMultipleTest
  • NodeTitleTest
  • SummaryLengthTest

And then resolving the rest of what fails on the bot, and reverting what gets fixed in core.

More tomorrow.

xjm’s picture

Project: VDC » Drupal core
Issue summary: View changes

add another blocker

xjm’s picture

Issue summary: View changes

Updated issue summary.

xjm’s picture

Issue summary: View changes

Updated issue summary.

xjm’s picture

Project: Drupal core » VDC

So ContextualDynamicContextTest, LocaleContentTest, LocalePathTest, the misnamed NodeLoadMultipleTest, and SummaryLengthTest all fairly legitimately want to test the node listing, so adding Views as a dependency there is fine. I think the assertion that checks the front page in NodeTitleTest should be moved to NodeLoadMultipleTest. (Edit: and maybe that last one should be renamed, but that is probably out of scope.)

dawehner’s picture

Let's benchmark the listing already: #1811816: Benchmark node_page_default vs. node view

xjm’s picture

I reverted the change to MenuTest. That test really does want the whole enchilada of the standard profile, so using different paths isn't really justified, I don't think. So the proper fix for that one is blocked on being able to add Views to the standard profile.

xjm’s picture

Project: VDC » Drupal core
Issue summary: View changes

Updated issue summary.

xjm’s picture

Project: Drupal core » VDC

BreadcrumbTest also legitimately needs the whole standard profile.

xjm’s picture

Project: VDC » Drupal core
Issue summary: View changes

Updated issue summary.

xjm’s picture

Project: Drupal core » VDC

I just spent several hours trying to get CommentInterfaceTest to not rely on the standard profile, and it's not worth it. We can consider that one blocked on getting standard working too. Opened #1812034: Only use standard profile where necessary in comment.module tests (10% bot speed-up).

xjm’s picture

Project: VDC » Drupal core
Issue summary: View changes

Updated issue summary.

xjm’s picture

Project: Drupal core » VDC
FileSize
20.44 KB

Okay, here's a patch that removes all the node decoupling in favor of the patches that have all been either fixed or RTBCed in the queue.

tim.plunkett’s picture

FileSize
19.54 KB

Here's a new patch, just rerolled after #1026616: Implement an entity render controller

tim.plunkett’s picture

FileSize
19.53 KB

Rerolled.

tim.plunkett’s picture

Status: Needs review » Postponed
catch’s picture

Is #1806370: Do full performance testing on the main node listing before and after it is converted to a view really postponed on this, and this really postponed on the standard install profile? I'd like to get some performance testing done of Views 8.x pretty quickly, and before/after front page testing is usually a pretty good example.

dawehner’s picture

@catch
It is for sure not really blocked as the node listing itself is working so #1811816: Benchmark node_page_default vs. node view is an issue with a propoer performance testing.

xjm’s picture

Project: VDC » Drupal core
Version: » 8.x-dev
Component: Code » node.module
Priority: Normal » Major
xjm’s picture

+++ b/core/modules/node/config/views.view.frontpage.ymlundefined
@@ -0,0 +1,139 @@
+description: 'A list of nodes marked as to be shown on the frontpage.'

See #1818056: Reduce descriptions of default views. Actually the new text is pretty decent. How about:

A list of nodes marked for display on the front page.

or even simply:

A list of promoted node teasers.

yoroy’s picture

promoted, node and teasers are very Drupally words that we've seen new users struggle with, lets not cram those all into something that should clarifiy things. The first rewrite in #40 seems better to me.

wundo’s picture

I don't understand why this patch requires Views UI, Shouldn't only Views be enough?

damiankloip’s picture

Are you referring to #36? Otherwise, I can't see where the dependency is coming from in this issue? :)

wundo’s picture

#36 and the issue description: "Switch to the VDC sandbox installation. Be sure to enable the Views and Views UI modules (necessary until they are added to the standard profile)"

xjm’s picture

#44 That's just to emulate how it would be with standard profile installed once #1807020: Add Views and Views UI to the standard install profile is fixed. You won't have this view and not have Views UI enabled out of the box. You can choose to disable Views UI later, but best to user-test this issue with it on.

Besides, half the fun is seeing the little context links to edit the view right there on the front page. :)

lpalgarvio’s picture

check Admin Views for ideas and code
http://drupal.org/project/admin_views

xjm’s picture

#46, no, we are using the patch in this issue.

xjm’s picture

Status: Postponed » Needs review
FileSize
13.97 KB

Status: Needs review » Needs work

The last submitted patch, views-1806334-48.patch, failed testing.

xjm’s picture

The variable/state value from #1824834: Covert default_nodes_main variable to CMI system should be removed entirely by this patch as well.

dawehner’s picture

Status: Needs work » Needs review
FileSize
13.99 KB

Just posting a rerole to see whether the tests are green.

Status: Needs review » Needs work

The last submitted patch, drupal-1806334-51.patch, failed testing.

dawehner’s picture

Status: Needs work » Needs review
FileSize
24.34 KB
10.35 KB

Let's fix a bunch of the views related tests by decoupling them from the frontpage view.

Status: Needs review » Needs work

The last submitted patch, drupal-1806334-53.patch, failed testing.

dawehner’s picture

Status: Needs work » Needs review
FileSize
26.17 KB
11.07 KB

Totally forgot to add the new base class. The interdiff is relative to comment #51

Status: Needs review » Needs work

The last submitted patch, drupal-1806334-55.patch, failed testing.

xjm’s picture

Status: Needs work » Needs review
FileSize
26.17 KB

Just a reroll. I'll try to pick off more of the failures.

xjm’s picture

Oh. Recent patches seem to sort of... not include the view. That could be causing part of the difficulty. ;)

xjm’s picture

FileSize
29.64 KB

This should help...

Status: Needs review » Needs work

The last submitted patch, views-1806334-59.patch, failed testing.

xjm’s picture

Status: Needs work » Needs review
FileSize
30.83 KB

And the handler...

Status: Needs review » Needs work

The last submitted patch, views-1806334-64.patch, failed testing.

xjm’s picture

So something weird is going on when the test runner runs config_import_invoke_owner() -- it tries to invoke views_config_import_create() even though Views is not supposed to be enabled. Locally I can work around this by disabling Views in the parent site (parent site environment leaking into the child I guess), but I'm confused as to why it's happening on testbot.

Related:

sun’s picture

@xjm: Can you provide the debug_backtrace() for that call?

xjm’s picture

FileSize
69.71 KB
6.02 KB

So the backtrace is over 1 GB with arguments because of the DIC stuff. Good times!

Attached is the full call chain without args, and then the relevant part of the backtrace with the view object truncated.

xjm’s picture

xjm’s picture

@tim.plunkett solved it with this:

+++ b/core/includes/config.incundefined
@@ -256,7 +256,7 @@ function config_import_invoke_owner(array $config_changes, StorageInterface $sou
       // Check whether the module implements hook_config_import() and ask it to
       // handle the configuration change.
       $handled_by_module = FALSE;
-      if (module_hook($module, 'config_import_' . $op)) {
+      if (module_exists($module) && module_hook($module, 'config_import_' . $op)) {
         $old_config = new Config($name, $target_storage);
         $old_config->load();

So back to decoupling stuff. :)

xjm’s picture

Status: Needs work » Needs review
FileSize
35.34 KB

Attached:

  • Adds the fix from #70.
  • Fixes the minimal profile so it doesn't try to use the frontpage view as its frontpage.
  • Fixes more test failures.

Filed as separate issues:

xjm’s picture

Oh, I should also note that the comment module test changes should be compatible with #731724: Convert comment settings into a field to make them work with CMI and non-node entities as far as I know.

Status: Needs review » Needs work

The last submitted patch, views-1806334-71.patch, failed testing.

xjm’s picture

xjm’s picture

Status: Needs work » Needs review
FileSize
638 bytes
36.89 KB

So I think between the issues above and this patch we've got it down to just the "real" failures--the bad assumption in ModuleEnableDisableTest that all a module's config is in its namespace (#1776830: [META-1] Installation and uninstallation of configuration provided by a module that belongs to another module's API), and the lack of an upgrade path.

The upgrade path (shown in the interdiff) causes the upgrade path tests to choke with:

The service definition "plugin.manager.views.access" does not exist.

Halp. :(

sun’s picture

I've seen that update.php exception while working on and debugging many other patches in the meantime - definitely not related to this issue, and thus we should create a separate, dedicated issue for it. (update.php has not been adjusted for the kernel at all recently, which clear appears to be the cause, but then again, update.php cannot boot a regular kernel in the first place, which gets us into a very hairy situation... anyway, separate issue.)

xjm’s picture

+++ b/core/modules/node/config/views.view.frontpage.ymlundefined
@@ -0,0 +1,139 @@
+description: 'A list of nodes marked as to be shown on the frontpage.'

Oh, this still needs to be changed to:
A list of nodes marked for display on the front page.

+++ b/core/modules/node/lib/Drupal/node/Plugin/views/area/ListingEmpty.phpundefined
@@ -0,0 +1,44 @@
+ * Definition of Drupal\node\Plugin\views\area\LinkAdd.

Contains.

+++ b/core/modules/node/lib/Drupal/node/Plugin/views/area/ListingEmpty.phpundefined
@@ -0,0 +1,44 @@
+ * An area plugin to display a node/add link.

+++ b/core/modules/views/lib/Drupal/views/Tests/Plugin/RelationshipJoinTestBase.phpundefined
@@ -0,0 +1,70 @@
+ * Base class for both JoinTest and RelationshipTest to provide a relationship.

Needs verb.

+++ b/core/modules/node/lib/Drupal/node/Tests/NodeTitleTest.phpundefined
@@ -17,7 +17,7 @@ class NodeTitleTest extends NodeTestBase {
-  public static $modules = array('comment');
+    public static $modules = array('comment', 'views');

Indentation fail.

xjm’s picture

I'll wait for testbot to catch up and expose the bug before filing an issue per #76. The bit from #70 may merit its own issue as well.

xjm’s picture

Issue summary: View changes

Updated issue summary.

xjm’s picture

xjm’s picture

xjm’s picture

Issue summary: View changes

Updated issue summary.

xjm’s picture

Issue summary: View changes

Updated issue summary.

xjm’s picture

Status: Needs review » Needs work
xjm’s picture

Issue summary: View changes

Updated issue summary.

xjm’s picture

Issue summary: View changes

.

dawehner’s picture

FileSize
943 bytes

Provided an upgrade test for the frontpage view.

xjm’s picture

+++ b/core/modules/system/lib/Drupal/system/Tests/Upgrade/SystemUpgradePathTest.phpundefined
@@ -97,5 +97,11 @@ public function testVariableUpgrade() {
+    // Verify that views and the frontpage view got enabled.
+    $this->assertTrue(module_exists('views'), 'Views got enabled during the upgrade.');
+    $view = views_get_view('views');
+    $this->assertTrue($view->storage->isEnabled(), 'The frontpage view is enabled after the upgrade.');

This should be wrapped in a condition for the frontpage being node, I think?

Eventually we will want to convert more listings, all of which would require Views to be enabled, so we would add those conditions then as well.

xjm’s picture

Issue summary: View changes

Updated issue summary.

xjm’s picture

xjm’s picture

Issue summary: View changes

Updated issue summary.

xjm’s picture

Filed #1850418: Provide D7 -> D8 Views upgrade path in contrib, not core which blocks the update hook added in this issue.

xjm’s picture

Issue summary: View changes

.

xjm’s picture

Issue summary: View changes

.

xjm’s picture

Issue summary: View changes

Updated issue summary.

xjm’s picture

Issue summary: View changes

Updated issue summary.

xjm’s picture

Status: Needs work » Needs review
FileSize
3.98 KB
36.22 KB

Recent cleanups and chasing head. @dawehner is correct that te expected value of the system.site.page.front in SystemUpgradePathTest is already 'node', but we can't put that assertion there because Views will not ne enabled for SystemUpgradePathTest. We can add @dawehner's assertions in a ViewsUpgradePathTest once update.php is fixed.

Status: Needs review » Needs work

The last submitted patch, views-1806334-87.patch, failed testing.

sun’s picture

Quite important consideration, as I noticed the "Convert" in the issue title only now:

This patch attempts to actually remove and replace the non-views-based listing of nodes on /node with a views-based listing.

Consequently, this adds a relatively huge dependency on Views module to Node module. Essentially, you will not be able to use Drupal in any basic/sensible way without Views module anymore.

I'm not sure whether that is a good idea. Views is nice and all for creating and overriding custom, user-configurable listings. But Views is also a mammoth thing. Doing this conversion here, instead of overriding the route/path with a view, would essentially set the precedent for "convert all listings into views" — having the end result of rendering Drupal unusable without Views module being enabled - which in turn would make Views a required module. I do not think that Views is ready for that yet. I always assumed that to be D9+ material (if at all).

For D8 it would make more sense to me if Node module would ship with a default view that allows to replace the /node listing with a views-based listing. I wouldn't really care whether that default view is enabled or disabled by default. However, the essence is that there is only a views-based listing if Views module is enabled. If Views module is not enabled, then Node module is still fully operational and able to provide basic content functionality, which includes a basic listing of nodes.

If you want to pursue the full conversion/replacement idea, then I think there should be a separate issue first to discuss the consequences of doing so (which are much larger than creating and supplying this simple node default view).

webchick’s picture

"Consequently, this adds a relatively huge dependency on Views module to Node module. Essentially, you will not be able to use Drupal in any basic/sensible way without Views module anymore."

I actually don't think that's true. With Node module you can create content types, you can pull them into Panels pages, you can list them within an Organic group, you can request them with REST-based web services, etc. The fact that core has in the past shipped with a non-turn-offable page + RSS feed called "node" that arbitrarily exposed teasers of all nodes on your site that have an arbitrary checkbox checked, is what the bug is, IMO. I don't see a "dependencies[] = views" line added to node.info, so IMO the patch is fine.

cosmicdreams’s picture

Product vs Framework. This is about the default we want Drupal to ship with. With the default config of a Drupal 8 installation we're making the choice here to provide a configurable collection of nodes at /node.

Don't want that? Think we're hard-wiring a dependency of node.module on views.module?

Here's the litmus test:
1. install Drupal 8 with minimal installation profile
2. Create a content type
3. Add a bunch of nodes of that content type
4. Create a display of a collection of nodes without views.

It CAN be done. Therefore, no dependency.

xjm’s picture

Yeah, I pretty much agree with #90.

Doing this conversion here, instead of overriding the route/path with a view, would essentially set the precedent for "convert all listings into views"

I will say that converting (at least some) core listings to Views has always been part of the initiative's scope, and stated on our roadmap, meta issue, blog posts and etc., from the very first brainstorm we held back in May and in everything we've posted since. :)

We chose the node listing specifically because it's very much a feature. It's both easily discovered when you install Drupal, and easily replaced with something else. (How many sites do you have that actually use the default front page? My first question when I installed Drupal 4.7 was how to get rid of it.) In this patch, the node listing view is a part of the standard profile only, and that's a very deliberate choice.

However, @sun raises an important point that we have been debating in various channels for awhile, about whether we should convert listings that are more fundamental to basic site operations. There are pros and cons, and it needs very careful consideration, though out of scope here. We are planning on discussing this topic at a sprint this weekend, and I'll do a writeup based on that discussion and file an issue for it.

xjm’s picture

Sorry, small but critical typo in my last post: the promoted node listing view as the frontpage is a part of the standard profile only. The view is always available if you install both node + views, for administrators to do with as they wish, or not.

xjm’s picture

Also, as way of general reassurance since I keep finding my own posts insufficiently clear:

We do not intend for Views to be a required module in Drupal 8. We also do not intend to add a dependency on Views to fundamental site building modules like node and taxonomy. We may make optional features of these modules dependent on Views. I'll link the new issue here for everyone's reference once we file it, and then we can discuss the details more there. :)

xjm’s picture

Here's the followup from our discussion at the London sprint: #1864980: [meta] Figure out how to integrate Views into core

YesCT’s picture

Reading through... especially #83 and #87 are upgrade path tests still needed?

We can add @dawehner's assertions in a ViewsUpgradePathTest once update.php is fixed.

Was there another issue number for "once update.php is fixed"? Or was that to be part of this issue?

There is so much done already here. I know xjm is super busy (blocks!!!). Maybe some detailed next steps will help bring in someone more people to support this?

I'm sure anyone eager could try a reroll of #87 to continue the chase of head.

dawehner’s picture

xjm’s picture

Yes, this issue is totally blocked on #1848998: Problems with update_module_enable(), not my participation, and has been since Nov. 23 in #81. (It's not a coincidence that I started on the blocks patch shortly after that.) We cannot write passing upgrade path tests until the upgrade path works. :) Everything in #87 is still true, and the summary is still current.

Also, it's assigned to me still, by design. :) This is still the top priority issue in VDC and work on it will resume once it's unblocked.

YesCT’s picture

Status: Needs work » Postponed
xjm’s picture

Status: Postponed » Needs review
Issue tags: -VDC, -Needs upgrade path tests

#87: views-1806334-87.patch queued for re-testing.

Status: Needs review » Needs work
Issue tags: +VDC, +Needs upgrade path tests

The last submitted patch, views-1806334-87.patch, failed testing.

dawehner’s picture

+++ b/core/modules/views/lib/Drupal/views/Tests/Handler/RelationshipTest.phpundefined
@@ -7,12 +7,14 @@
+class RelationshipTest extends RelationshipJoinTestBase {

+++ b/core/modules/views/lib/Drupal/views/Tests/Plugin/JoinTest.phpundefined
@@ -13,8 +13,11 @@
+class JoinTest extends RelationshipJoinTestBase {

If we need some time anyway we could move this to another issue, as it's actually unrelated to that issue.

We certainly need a rerole after that time, if it's not done until monday I'm happy to split it up.

dawehner’s picture

Status: Needs work » Needs review
FileSize
36.43 KB

Just a plain old rerole and codestyle fix.

Status: Needs review » Needs work

The last submitted patch, drupal-1806334-104.patch, failed testing.

dawehner’s picture

Just let's wait on #1848998: Problems with update_module_enable() and a lot of them should get green.

xjm’s picture

Status: Needs work » Needs review
Issue tags: -Needs upgrade path tests
FileSize
35.8 KB

Status: Needs review » Needs work

The last submitted patch, node-frontpage-1806334-107.patch, failed testing.

dawehner’s picture

xjm’s picture

I think #1893850: Cleanup relationship tests and don't use the node module should probably go in first; it will simplify this patch.

dawehner’s picture

Status: Needs work » Needs review
FileSize
30.16 KB

Rerolled against lot of changes, and fixed many of the failures.

It feels like we should really get at least one conversion in before feb 18th?

YesCT’s picture

Status: Needs review » Needs work
+++ b/core/modules/views/lib/Drupal/views/Plugin/views/area/Title.phpundefined
@@ -65,4 +65,12 @@ public function render($empty = FALSE) {
+  }
+
+
 }

1 extra newline. (non-blocking)

+++ b/core/modules/views/lib/Drupal/views/Tests/Handler/RelationshipTest.phpundefined
@@ -24,6 +24,7 @@ class RelationshipTest extends RelationshipJoinTestBase {
   public static $testViews = array('test_view');
 
+
   /**
    * Maps between the key in the expected result and the query result.

1 extra newline (non-blocking)

+++ b/core/modules/views/lib/Drupal/views/Tests/Plugin/PagerTest.phpundefined
@@ -17,7 +17,7 @@ class PagerTest extends PluginTestBase {
-  public static $testViews = array('test_store_pager_settings', 'test_pager_none', 'test_pager_some', 'test_pager_full', 'test_view_pager_full_zero_items_per_page');
+  public static $testViews = array('test_store_pager_settings', 'test_pager_none', 'test_pager_some', 'test_pager_full', 'test_view_pager_full_zero_items_per_page', 'test_view');
 

@@ -44,13 +44,16 @@ public function testStorePagerSettings() {
-    $this->drupalGet('admin/structure/views/view/frontpage/edit');
-
+    $this->drupalGet('admin/structure/views/view/test_view/edit');

test_view seems not specific enough. I suggest test_frontpage

(I'm not sure. Why is a test view being tested instead of testing the actual view being added?)

+++ b/core/modules/views/lib/Drupal/views/Tests/UI/DefaultViewsTest.phpundefined
@@ -33,7 +33,7 @@ public static function getInfo() {
     // Make sure the front page view starts off as disabled (does not appear on
     // the listing page).
-    $edit_href = 'admin/structure/views/view/frontpage/edit';
+    $edit_href = 'admin/structure/views/view/glossary/edit';

glossary?

Oh, is it that the frontpage is enabled by default, so to test some views are disabled by default and can be enabled, so use a different view than frontpage?

Probably the comments need to change.

dawehner’s picture

Status: Needs work » Needs review
FileSize
2.53 KB
29.73 KB

Thanks for the review! Please testbot run that patch :)

1 extra newline. (non-blocking)

Fixed

1 extra newline (non-blocking)

Fixed

(I'm not sure. Why is a test view being tested instead of testing the actual view being added?)

The idea is to not use the frontpage anymore, so if you test against a generic view, we use test_view.

Probably the comments need to change.

Adapted the comments.

YesCT’s picture

Issue tags: +Needs manual testing

writing down some things from an irc conversation with @dawehner

+++ b/core/modules/views/lib/Drupal/views/Tests/AnalyzeTest.phpundefined
@@ -41,10 +48,8 @@ public function setUp() {
   function testAnalyzeBasic() {
     $this->drupalLogin($this->admin);
-    // Enable the frontpage view and click the analyse button.
-    $view = views_get_view('frontpage');
 
-    $this->drupalGet('admin/structure/views/view/frontpage/edit');
+    $this->drupalGet('admin/structure/views/view/test_view/edit');

this and other substitutions of using the test_view (already existing, and not introduced as part of this patch) instead of the frontpage view makes sense.

previously the frontpage was used for test unrelated to the frontpage because it was a view that was handy.

+++ b/core/modules/views/lib/Drupal/views/Tests/UI/DefaultViewsTest.phpundefined
@@ -31,34 +31,34 @@ public static function getInfo() {
   function testDefaultViews() {
-    // Make sure the front page view starts off as disabled (does not appear on
-    // the listing page).
-    $edit_href = 'admin/structure/views/view/frontpage/edit';
+    // Make sure the view starts off as disabled (does not appear on the listing
+    // page).
+    $edit_href = 'admin/structure/views/view/glossary/edit';

this also makes sense, is replacing the use of the frontpage view to do some (non-frontpage specific) testing with a different default view that starts disabled.

+++ b/core/modules/views/lib/Drupal/views/Plugin/views/area/Title.phpundefined
@@ -65,12 +65,4 @@ public function render($empty = FALSE) {
-  /**
-   * Implements \Drupal\views\Plugin\views\area\AreaPluginBase().
-   */
-  public function render($empty = FALSE) {
-    // Do nothing for this area handler.
-  }
-
-

from the interdiff, due to some merge problems this render function have been twice in the title.php. So this is just removing that.

+++ b/core/modules/views/lib/Drupal/views/Tests/AnalyzeTest.phpundefined
@@ -41,10 +48,8 @@ public function setUp() {
   function testAnalyzeBasic() {
     $this->drupalLogin($this->admin);
-    // Enable the frontpage view and click the analyse button.
-    $view = views_get_view('frontpage');
 
-    $this->drupalGet('admin/structure/views/view/frontpage/edit');
+    $this->drupalGet('admin/structure/views/view/test_view/edit');

So, far, to me, the code makes sense, comments are updated, coding standards look good, and the recent interdiff looks good. this is rtbc except...

next steps:
@dawehner says one test is failing locally, but might be unsure of how to fix it.
also, a manual test of the frontpage would be good

Status: Needs review » Needs work

The last submitted patch, drupal-1806334-113.patch, failed testing.

dawehner’s picture

Status: Needs work » Needs review
FileSize
32.52 KB
3.24 KB

This will potentially fix like 90% of the problems.

Status: Needs review » Needs work

The last submitted patch, drupal-1806334-116.patch, failed testing.

tim.plunkett’s picture

Status: Needs work » Needs review
FileSize
1.53 KB
34.05 KB

Oh! Those are the same failures I fixed in #1851086: Replace admin/people with a View. Which makes sense.

Status: Needs review » Needs work

The last submitted patch, vdc-1806334-118.patch, failed testing.

tim.plunkett’s picture

Issue tags: +Needs upgrade path

Okay, that fails just because config('system.site')->get('page.front') == 'node', and views is not on.

In #83 and #84 this was discussed, but there was never an upgrade path added.

dawehner’s picture

Status: Needs work » Needs review
FileSize
1.21 KB

Please!

dawehner’s picture

FileSize
35.52 KB

So let's test the patch now.

Status: Needs review » Needs work

The last submitted patch, drupal-1806334-122.patch, failed testing.

tim.plunkett’s picture

Status: Needs work » Needs review
FileSize
35.52 KB

- $this->assertTrue($this->container->get('module_handler')-moduleExists('views'), 'Views is enabled after the upgrade.');
+ $this->assertTrue($this->container->get('module_handler')->moduleExists('views'), 'Views is enabled after the upgrade.');

:)

Status: Needs review » Needs work

The last submitted patch, drupal-1806334-122.patch, failed testing.

tim.plunkett’s picture

Assigned: xjm » Unassigned
Status: Needs work » Needs review
FileSize
35.52 KB
902 bytes

That'll teach me to run tests locally first.

dawehner’s picture

Status: Needs review » Reviewed & tested by the community

I should have done this as well :)

Let's stop forward.

catch’s picture

I know #1811816: Benchmark node_page_default vs. node view is open but it'd be good to get a before/after before this goes in.

Both for xhprof profiling, and also for the difference in the page size since the markup will change here as well.

Dries’s picture

Looked at the code and it looks good to go. I agree that we should look at the profiling results first though.

YesCT’s picture

Issue tags: +needs profiling

tagging for profiling

effulgentsia’s picture

Status: Reviewed & tested by the community » Needs work

Profiling is work :)

dawehner’s picture

Status: Needs work » Needs review
FileSize
508.22 KB
390.76 KB
99.37 KB

I did a simply xhprof run with 50 total nodes and came to the following result.

Fabianx’s picture

I also redid some of my original benchmarks, so those are comparable with old data (http://drupal.org/node/1811816#comment-6675896);

=== core-node-50..core-views-50 compared (512563c5e130a..51256415a891a):

ct  : 94,685|101,963|7,278|7.7%
wt  : 328,388|361,731|33,343|10.2%
cpu : 328,020|360,023|32,003|9.8%
mu  : 9,195,584|12,082,464|2,886,880|31.4%
pmu : 9,554,600|12,529,240|2,974,640|31.1%

ct = function calls, wt = wall time, cpu = cpu time used, mu = memory usage, pmu = peak memory usage

This was with 1000 runs - same results. APC autoloader is off.

Views is and keeps being 32 ms worse in this benchmark, but with 50 nodes and no caching on that is not too bad.

But that overhead I already explained in http://drupal.org/node/1811816#comment-6670756 and it keeps being valid.

dawehner’s picture

Status: Needs review » Reviewed & tested by the community

On mu/pmu you basically see how much memory a full loaded view object needs.

In general 32ms worse seems to be acceptable, especially if you can turn on caching. If we do that though, we need first a better support for cache tags, as currently you might end up with new nodes not appearing on the node listing page, as the page is cached.

Set back to RTBC? (Not sure whether that is the proper status).

catch’s picture

2mb for a fully loaded view object seems a bit wrong to me, or at least maybe that's gone up rather than down since 7.x. I'm trying to remember when I lasted tested this for 7.x-3.x but can't find the issue at the moment. Might try to look myself another time (unfortunately no chance this week).

#1605290: Enable entity render caching with cache tag support is probably going to have to move to being independently critical between Views, EntityNG and Twig.

Berdir’s picture

FileSize
170 KB
145.67 KB
43.01 KB

I've been doing some tests too and it looks quite nice here

Disclaimer:
* I'm using the APC class loader, which removes those 10% class loader stuff from @dawehner's screenshot.
* I've disabled views_ui although that didn't seem to make such a big difference.
* Something that needs to be kept in mind is that function calls have a considerable cost when profiling. So when having more function calls, then it's actually less bad than it looks with xhprof.

Notes:
* The time difference is quite small for me, actually (overview.png)
* Seeing a handful of additional cache loads for the plugins, but that's about it for queries.
* I can confirm the additional 2MB in the overview but I can't really track them down. There's a lot of "movement" in theme functions, it looks like the main node rendering happens now in theme@2 and no longer theme@3, so one level less nesting but it seems to sum up. There's a lot of red (more memory) lines below then but it's a lot of small stuff, so nothing obvious to improve (functions.png)

So, it looks quite good to me. Will try to do another round of "What happens if I add 20 recent comment views blocks on a page" in the other issue to see if there some generic overheads but I think a lot was already improved.

Also did a quick try with a field based view (title, image, body) which looks visually very similar to the node listing but is 34% faster (still 1MB more memory, though). No idea how that will work with an EFQ backend but I think it's a nice example for the "we're comparing apples with oranges" argument. I think the number of sites that have to worry about performance (apart from the crappy shared host performance problems) and are using the default node view are very low. Even simple blogs often use views because they want a different sort order, or a filter or something like that.

Therefore, having a view there by default instead of an arbitrary node listing that nobody uses makes *a lot* of sense, because it means the typical frontpage profiling is profiling the same thing that real sites will use. So in short, a lot of words for saying +1 :)

sun’s picture

Mmm... @Berdir's bench shows a 6% "improvement" in ModuleHandler::load().

That looks highly suspicious.

Fabianx’s picture

#137: This is within error margin. Without doing a test 1000 times and then use aggregate or minimum, you'll always have such "error margins".

And even then it can happen. I check for mine (minimum of 1000 runs) and I have "1" ms difference.

#136: Creating a field based view is a great idea and I'll benchmark that as well. Also I'll redo benchmarks with APC classloader on.

I also had an error in my benchmark :-/ as my min code did not actually run:

Here is new and now accurate numbers, I'll fix xhprof-kit and will retest more automatically soon:

This now is benchmarked like:

XHProf_Start
index.php
XHProf_End

while the previous benchmarks had been just using "devel".

Benchmak setup - No APC autoloader

* PHP 5.3
* APC Autoloader - Off
* node vs. frontpage (view) vs. frontpage-fields (view with fields)

Benchmark results: /node vs. /frontpage

=== core-node-50..core-frontpage-50 compared (512a1f7f217a6..512a20b11c1ab):

ct  : 99,800|107,952|8,152|8.2%
wt  : 352,534|385,851|33,317|9.5%
cpu : 352,023|384,024|32,001|9.1%
mu  : 14,421,096|17,745,512|3,324,416|23.1%
pmu : 14,801,280|18,206,632|3,405,352|23.0%
--
ct = function calls, wt = wall time, cpu = cpu time used, mu = memory usage, pmu = peak memory usage

Permalink for easy browsing: http://www.lionsad.de/xhprof/xhprof_html/?run1=512a1f7f217a6&run2=512a20...

Benchmark results: /node vs. /frontpage-fields

=== core-node-50..core-frontpage-fields-50 compared (512a1f7f217a6..512a226436ce4):

ct  : 99,800|77,394|-22,406|-22.5%
wt  : 352,534|303,343|-49,191|-14.0%
cpu : 352,023|300,019|-52,004|-14.8%
mu  : 14,421,096|17,365,568|2,944,472|20.4%
pmu : 14,801,280|17,639,176|2,837,896|19.2%
--
ct = function calls, wt = wall time, cpu = cpu time used, mu = memory usage, pmu = peak memory usage

Permalink for easy browsing: http://www.lionsad.de/xhprof/xhprof_html/?run1=512a1f7f217a6&run2=512a22...

----------

Benchmak setup - With APC autoloader

* PHP 5.3
* Classloader: APC
* node vs. frontpage (view)

Benchmark results: /node vs. /frontpage

=== core-node-50-apc..core-views-50-apc compared (512a40915a5dd..512a40ad78082):

ct  : 95,421|101,134|5,713|6.0%
wt  : 341,765|370,369|28,604|8.4%
cpu : 340,021|368,023|28,002|8.2%
mu  : 14,438,832|17,763,760|3,324,928|23.0%
pmu : 14,818,488|18,225,384|3,406,896|23.0%

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

Permalink for easy browsing: http://www.lionsad.de/xhprof/xhprof_html/?run1=512a40915a5dd&run2=512a40...

----------

I will now always give both numbers and permalinks to XHProf Runs. :-)

Berdir’s picture

Discussed our results with FabianX in IRC, some more conclusions and thoughts.

- As you can see in the updated benchmarks, 7ms of the additional time is spent in the classloader and they go away when you use APC as I did.
- I'm doing the profiling manually ( usually run 3 times and use the fastest run) so there is a higher chance of errors. That said, my numbers seemed to be relatively stable.
- I'm using PHP 5.4, which probably contains a few performance improvements.
- We were testing with 50 nodes. That means that the code path where there actually is a difference between node_default_page() and views is a relatively small part of the total execution, ~80% of the time is spent in drupal_render_page. So small differences there (e.g. if you have different users that need to be loaded or a single one, logged in or not) change the total execution time and therefore the procentual difference between node_default_page() and views.
- FabianX and I also did an example test with just a single node, where we had comparable results of ~20% overhead despite quite different absolute numbers.
- @msonnabaum also mentioned in IRC that the used flags and whether xdebug is enabled or not have huge difference in xhprof. I had xdebug enabled on my laptop and it slowed it down ~30% (not used that in the published results, just an example). Did a test without XHPROF_FLAGS_CPU on my desktop and it was another ~25% faster.

All that said, I'm still not sure what a fair comparison would be, 1 node certainly isn't. And 50 is too much. And a single listing as a whole is tricky because views has a one-time overhead and many many sites will also have a view listing or two (or 10) in a block anyway.

IMHO, the shown regression in terms of performance ( be it my numbers of those of others) are worth it. Especially because we showed that there are various ways to make that up again for sites that care. Enable caching, switch to a field based view, ...

Fabianx’s picture

I agree with berdir. +1 for RTBC

Fabianx’s picture

I agree with berdir. +1 for RTBC

catch’s picture

Issue tags: +Novice

Still need a diff of page size here, that's something that could be done by a novice contributor, so tagging novice.

Fabianx’s picture

50 Nodes displayed:

Node: 95.02 KB (14.76 KB compressed)
Views: 98.58 KB (15.11 KB compressed)

Measured with Chrome Network tab as anonymous user.

dawehner’s picture

Assigned: Unassigned » dawehner
Status: Reviewed & tested by the community » Needs work

Installation still shows some debug messages :(

dawehner’s picture

After some debugging the problem is the following: The moduleHandler sort of caches hook_hook_info way to early, so there is no file included for node.views.inc

On later time of the installation (for example another batch request) the modules are enabled, so the hook info is there and views can fire it's hooks.

YesCT’s picture

Issue tags: -Novice

taking novice off since the page size comparison was done.

dawehner’s picture

YesCT’s picture

Status: Needs work » Reviewed & tested by the community

I think that means we are back to rtbc.

YesCT’s picture

#126: vdc-1806334-126.patch queued for re-testing.

dawehner’s picture

Assigned: dawehner » Unassigned
Status: Reviewed & tested by the community » Needs work

Well, It's more like that this issue is blocked on the other one :)

dawehner’s picture

Status: Needs work » Needs review
Issue tags: -Needs manual testing, -needs profiling, -VDC, -Needs upgrade path

#126: vdc-1806334-126.patch queued for re-testing.

Status: Needs review » Needs work
Issue tags: +Needs manual testing, +needs profiling, +VDC, +Needs upgrade path

The last submitted patch, vdc-1806334-126.patch, failed testing.

dawehner’s picture

Status: Needs work » Needs review
FileSize
35.58 KB

Rerolled.

ParisLiakos’s picture

debug messages still there:(

YesCT’s picture

+++ b/core/modules/views/lib/Drupal/views/Tests/UI/DefaultViewsTest.phpundefined
@@ -77,22 +77,22 @@ function testDefaultViews() {
-    // $this->drupalGet('frontpage');
+    // $this->drupalGet('glossary');

@@ -102,19 +102,19 @@ function testDefaultViews() {
     // $this->assertUrl('admin/structure/views');
     // $this->assertNoLinkByHref($edit_href);

maybe these are the debug messages referred to?

they were not introduced by this issue though..

YesCT’s picture

oh #144 says installation. So I'll try manually testing.

YesCT’s picture

FileSize
263.43 KB

here they are:
debug.png

Debug:
'Missing handler: node created sort'
in views_get_handler() (line 934 of core/modules/views/views.module).
Debug:
'Missing handler: node sticky sort'
in views_get_handler() (line 934 of core/modules/views/views.module).
Debug:
'Missing handler: node promote filter'
in views_get_handler() (line 934 of core/modules/views/views.module).
Debug:
'Missing handler: node status filter'
in views_get_handler() (line 934 of core/modules/views/views.module).
Debug:
'Missing handler: views area area'
in views_get_handler() (line 934 of core/modules/views/views.module).
Debug:
'Missing handler: node node_listing_empty area'
in views_get_handler() (line 934 of core/modules/views/views.module).
Debug:
'Missing handler: views title area'
in views_get_handler() (line 934 of core/modules/views/views.module).
ParisLiakos’s picture

Now, after applying the patch installer dies:
Fatal error: Call to a member function id() on a non-object in /var/www/d8/core/modules/menu/menu.module on line 210
Lets see what bot says, mybe my installation is messed up
#153: drupal-1806334-153.patch queued for re-testing.

Status: Needs review » Needs work
Issue tags: +Needs manual testing, +needs profiling, +VDC, +Needs upgrade path

The last submitted patch, drupal-1806334-153.patch, failed testing.

ParisLiakos’s picture

Status: Needs work » Needs review
FileSize
531 bytes
35.58 KB

this should take care of that..no idea yet what happens with the debug messages

dawehner’s picture

@rootatwc

How should that fix the messages when install drupal? I would love to understand that :)

ParisLiakos’s picture

No, this is to fix the fatal error (see #158)...debug messages are still there..i am still investigating, but i have an idea

Status: Needs review » Needs work

The last submitted patch, drupal-1806334-159.patch, failed testing.

dawehner’s picture

Ah great. In general I still think we should have tests for that behavior.

ParisLiakos’s picture

Status: Needs work » Needs review

#160: drupal-1806334-159.patch queued for re-testing.

catch’s picture

3kb is a fair bit, although in context it's unfortunately not that much.

What about the difference in document.getElementsByTagName("*").length ?

ParisLiakos’s picture

FileSize
661 bytes
36.23 KB

this should get rid of debug messages..getHookInfo acts on a full moduleList, but none of this modules is loaded yet..and then hookInfo is cached

dawehner’s picture

FileSize
778 bytes
36.22 KB
+++ b/core/lib/Drupal/Core/Extension/ModuleHandler.phpundefined
@@ -235,6 +235,8 @@ public function getHookInfo() {
+      // Make sure that the module is loaded before checking.
+      $this->load($module);

As we iterate over all modules anyway, can't we just do $this->reload() before the foreach?

Status: Needs review » Needs work
Issue tags: -Needs manual testing, -needs profiling, -VDC, -Needs upgrade path

The last submitted patch, drupal-1806334-168.patch, failed testing.

ParisLiakos’s picture

Status: Needs work » Needs review
Issue tags: +Needs manual testing, +needs profiling, +VDC, +Needs upgrade path

#168: drupal-1806334-168.patch queued for re-testing.

ParisLiakos’s picture

Status: Needs review » Reviewed & tested by the community

i am gonna rtbc this, since it would be great to have it for the sprint weekends..i think we just need sun's feedback on this last change on moduleHandler..if he is fine with it i dont see any reason not to commit this...but, i ll leave the rest on maintainers:)

Edit:
document.getElementsByTagName("*").length:

Before:
Logged in: 451
Logged out: 100

After:
Logged in: 457
Logged out: 102

xjm’s picture

I tested the patch manually and confirmed that the debug messages are gone. I did notice a JavaScript bug with the contextual links on the View, but that's out of scope here so I'll file it separately. I think this is finally ready!

+++ b/core/lib/Drupal/Core/Extension/ModuleHandler.phpundefined
@@ -234,9 +234,9 @@ public function getHookInfo() {
+    // Make sure that the modules are loaded before checking.
+    $this->reload();
     foreach ($this->moduleList as $module => $filename) {
-      // Make sure that the module is loaded before checking.
-      $this->load($module);

This change is fine. It's essentially the same code, just more clearly factored. :)

xjm’s picture

Status: Reviewed & tested by the community » Needs review

Oh, @rootatwc is referring to the change in #167. That does need review -- please don't mark your own patches RTBC. ;)

dawehner’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: -Needs manual testing, -needs profiling, -Needs upgrade path

@xjm

If it's his patch, I can mark it as RTBC :)

The change in #160 is perfect. The change in #167 is totally overridden by #168, so this seems to be fair.

dawehner’s picture

Nice, killed all the tags!

webchick’s picture

Status: Reviewed & tested by the community » Fixed
Issue tags: +SprintWeekend2013

Rock!! Awesome work, folks! It looks like catch's questions/concerns have been addressed. This will be SO awesome to have in core for the Drupal Global Sprint Weekend.

Committed and pushed to 8.x. YAY!!!!

lpalgarvio’s picture

=)

lpalgarvio’s picture

great work =)

Fabianx’s picture

Yay!

yched’s picture

Minor : core/modules/node/lib/Drupal/node/Plugin/views/area/ListingEmpty.php :

+/**
+ * @file
+ * Contains \Drupal\node\Plugin\views\area\LinkAdd.
+ */

Stale class name in the @file docblock ?

dawehner’s picture

Oh nice catch!

Opened a novice follow up for that: #1938132: ListingEmpty contains wrong @file

damiankloip’s picture

I didn't want to ruin the party here either, but we should change the empty area handler :/, So I created: #1938414: frontpage (/node) view should use unfiltered text for empty area handler

andypost’s picture

edit we have special CommentLinksTest for the purpose

+++ b/core/modules/comment/lib/Drupal/comment/Tests/CommentInterfaceTest.phpundefined
@@ -109,10 +109,6 @@ function testCommentInterface() {
-    // Correct link count
-    $this->drupalGet('node');
-    $this->assertRaw('4 comments', 'Link to the 4 comments exist.');
-

Any reason this assertion was removed?

sun’s picture

Status: Fixed » Needs work
+++ b/core/lib/Drupal/Core/Extension/ModuleHandler.php
@@ -234,6 +234,8 @@ public function getHookInfo() {
+    // Make sure that the modules are loaded before checking.
+    $this->reload();

It does not really look like we got to the bottom of why modules are suddenly not loaded when they ought to be loaded.

I additionally do not understand why this calls into reload() instead of loadAll().

We definitely need to change this into loadAll(), and we should also figure out why this is suddenly necessary, as it should not be necessary — instead, there's likely a race condition or bogus/incomplete procedure elsewhere in the code that needs to be fixed.

+++ b/core/profiles/minimal/minimal.install
@@ -14,9 +14,6 @@
 function minimal_install() {
...
-  // Set front page to "node".
-  config('system.site')->set('page.front', 'node')->save();

I do not really understand where the front page is configured to be 'node' in the Minimal profile now?

YesCT’s picture

Issue tags: +Novice

tagging Novice for the task of going through this issue, reading the comments, identifying needed follow-ups and opening those issues.
For anyone who decides to tackle that task, See http://drupal.org/node/1155816 for issue summary template info, and be sure to include a link back to this issue in the issues that are opened as follow-ups. Be sure to also add the followups to this issue summary's follow-up section. (I'll update the issue summary with this remaining task.)

YesCT’s picture

Issue summary: View changes

Updated issue summary.

dawehner’s picture

I do not really understand where the front page is configured to be 'node' in the Minimal profile now?

The frontpage of the minimal profile now is not /node anymore, it's /user, because that's the default value of system.site->page.front. Do you think we should install views in the minimal profile, just to have /node available, this feels really wrong :)

It does not really look like we got to the bottom of why modules are suddenly not loaded when they ought to be loaded.

You are right, if modules are loaded already, loadAll() will be enough. If modules aren't loaded, loadAll() will be okay as well.

ParisLiakos’s picture

Actually loadAll() wont work, because $this->loaded is TRUE..
this happens because during installation some modules are enabled without calling module_enable()..so, most of the time in the installer, only system's module hooks are loaded

This is not a problem when using module_enable() because it explicitly calls load() on the new enabled module:

$module_handler->setModuleList($module_filenames);
$module_handler->load($module);

So if you manually update the moduleList somewhere in your code, you *must* call load or reload methods if you want the new hooks from this module to be available..
test coming

ParisLiakos’s picture

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

Here we are..I dont know if we want module handler to keep moduleList and loadedFiles synchronized though. in my opinion i think it should...But maybe this is not the best way, maybe we should call reload() in resetImplementations() like dawehner originally proposed in irc

xjm’s picture

Status: Needs review » Fixed

FWIW, I set this back to NR because I suspected some of what's in #185. I had been pinging people to try to get review of that change, but then it got RTBCed and committed overnight. :P

Can we spin off followup issues please for #185 through #189? We're at almost 200 comments here. (Also, the failing test in #189 isn't.) :)

sun’s picture

Status: Fixed » Needs work

Follow-ups first, please.

FWIW, the suspicions in #188 basically tell that 1) the problem only exists in the installer, and 2) the problem only exists in the installer. We might want to look into the installer. ;)

That would also explain why the test is not able to detect the problem. We'd have to write a dedicated DUTB test that is actually able to resemble the installer environment of 0 enabled modules.


re: #187.2:
Let's also create a follow-up issue to discuss the fate of Minimal profile. The cumulative result of this change doesn't make much sense. We either need to 1) Add Views, or 2) Remove Node, or 3) Both.

stpaultim’s picture

I tried to spin-off the first issue raised in #185 to #1940274: Modules not loaded when they ought to be loaded in \Drupal\Core\Extension\ModuleHandler::buildHookInfo. But, I didn't fully understand it, so I'm not sure how helpful that was.

Also, created #1940306: Convert the node RSS feed to a display of the frontpage view based upon notes in the issue summary.

There is another issue here regarding the minimal profile, which I'm not comfortable spinning off cause I not sure what to say. Maybe someone else will have to finish this (and tidy up what I've done).

dawehner’s picture

Thanks for creating the followups!

dawehner’s picture

Issue summary: View changes

updated remaining tasks, not sure about the task already there regarding upgrade path

xjm’s picture

Status: Needs work » Fixed
Issue tags: -Novice

Let's also create a follow-up issue to discuss the fate of Minimal profile. The cumulative result of this change doesn't make much sense. We either need to 1) Add Views, or 2) Remove Node, or 3) Both.

I really don't think this is a problem. @sun can file a followup for that if he likes. :)

xjm’s picture

Issue summary: View changes

Updated issue summary.

xjm’s picture

Issue summary: View changes

Updated issue summary.

stpaultim’s picture

@YesCT suggested I go ahead and create the follow-up issue for comment #1806334-191: Replace the node listing at /node with a view so I created #1946526: Clean up Minimal profile modules

David_Rothstein’s picture

I just bumped #987242: The "Promoted to front page" checkbox doesn't do anything if the /node front page listing isn't used to major (and retitled it).

So does there also need to be an issue to add recommends[] support, so that Node module can recommend other modules (like Views, or Menu) be installed along with it? (There's an issue at #820054: Add support for recommends[] and fix install profile dependency special casing which sounds like that, but I believe it's actually about something a bit different.)

xjm’s picture

xjm’s picture

Issue summary: View changes

Added a follow-up issue.

xjm’s picture

Issue summary: View changes

Updated issue summary.

damiankloip’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Pancho’s picture

Title: Convert the node listing at /node to Views » Replace the node listing at /node with a view
Priority: Major » Critical
Status: Closed (fixed) » Active
Issue tags: +Needs change record

We seem to be missing a change notification here.
Think a single notice for all "Replace x with a view" would be enough or even better.

xjm’s picture

Title: Replace the node listing at /node with a view » [Change notification] Replace the node listing at /node with a view
webwarrior’s picture

catch’s picture

webwarrior’s picture

Status: Active » Fixed
Issue tags: -Needs change record

Change notification added:
https://drupal.org/node/2084727

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

ParisLiakos’s picture

Title: [Change notification] Replace the node listing at /node with a view » Replace the node listing at /node with a view
ParisLiakos’s picture

Issue summary: View changes

Updated issue summary.

xjm’s picture

Component: node.module » node system
Issue summary: View changes