Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 300947

Convert the recent_comments block to a view

$
0
0

Updated #107

Title says it all.

Details

  • The recent comments block had a very simple setting that allowed to configure the number of comments to show. Because one can easily configure the number of items (and more) in Views, this is "dropped" from the Block configuration screen.
  • This patch reproduces an inconsistency that existed with the old block and should be fixed in a follow-up: The comments are sorted by their creation date, but their modification/updated date is displayed. Although the use-case of editing comments is not common (although, *cough* Drupal.org *cough*) the block may show, e.g. "sadf 2 hours ago", "asdf 1 second ago" and that (wrong) order. See #1938664: Recent comments block sorts by creation date but displays updated date for fixing this.
  • The Views configuration files are very inconsistent in terms of their explicit-ness. Some settings are left out of the default config and, thus, saving a view without changing anything will result in a non-empty "diff" of the resulting configuration. Explicitly declaring all keys would make the config files *very* large, but I think there is no way around that, ultimately. Either way, this is not for this issue to solve. Because I generated the view by clicking it together in the UI, it is explicit in some parts and not in others (just like all other default views currently). See #1938654: Export all properties of all views handlers and plugins for fixing this properly.

Discussion items

  • As shown in the screenshot, the "3 hours" part of "3 hours ago" is wrapped in an < em > element by the view, whereas previously this was not the case. Because the view simply uses the default "Time ago (with "ago" appended)" display plugin, if we want to retain the previous behavior, I think we should change the output of that plugin in general (i.e. for every view that uses it) instead of overriding the markup specifically for this view. I have no opinion on whether we want to remove the < em > or keep it, though.
  • The plugin name is kept as comments_recent as it was before. Because it belongs to comment module (without s) it might be better to name it comment_recent. I guess we should just leave this as is for now and wait for #1862600: Entity type names/IDs are not properly namespaced by owner (e.g., taxonomy.term vs. taxonomy_term) to happen.

Steps to test

  1. sudo rm -r sites; git checkout sites;
  2. git pull --rebase
  3. drush am 1938062
  4. drush -y si --account-pass=admin --db-url="mysql://root:root@localhost/d8-patch" --site-name=1938062
  5. get devel (git clone --branch 8.x-1.x http://git.drupal.org/project/devel.git)
  6. under Extend, enable the Devel generate module
  7. generate nodes and comments admin/config/development/generate/content be sure to change maximum number of comment per node (I used 4)
  8. ?

Oops. devel gets an error to. Can use filtered html instead of wysiwyg formatter to get around error when making comments.

Remaining Tasks

These are blocking this issue.

UI Changes

After screenshots

placing the block
num_items.png
editing the block
editing-recentcommentsblock.png
the block
block-recentcomments.png
hovering on the block, shows contextual edit. both the configure block and edit view links work.
hover-recentcomments.png

Follow-up issues

Related Issues


Viewing all articles
Browse latest Browse all 300947

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>