Support from Acquia helps fund testing for Drupal Acquia logo

Comments

sun’s picture

Status: Active » Needs review
FileSize
5.48 KB

This should cut it.

If this passes the bot, then this issue should be marked postponed on #891112: Replace theme_item_list()'s 'data' items with render elements, since that should go in first, since it's way harder to roll.

Status: Needs review » Needs work

The last submitted patch, drupal8.theme-item-list-type-tag.1.patch, failed testing.

sun’s picture

Status: Needs work » Needs review
FileSize
5.6 KB

Re-rolled against HEAD.

sun’s picture

sun’s picture

Re-rolled against HEAD.

Status: Needs review » Needs work

The last submitted patch, drupal8.theme-item-list-type-tag.5.patch, failed testing.

sun’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, drupal8.theme-item-list-type-tag.5.patch, failed testing.

sun’s picture

Tagging... Please feel free to take this over, don't know when I'll get back to it.

hawkeye.twolf’s picture

Status: Needs work » Needs review
FileSize
5.15 KB

Patch re-rolled. Uploading to check for for greenlight.

jenlampton’s picture

I don't like the variable name 'tag' since there are actually a lot of HTML tags in the item_list Twig template. Tag really only makes sense if you are concatenating strings to generate HTML tags as we did in Drupal 7: $output .= '<' . $tag . new Attribute($list_attributes) . '>';.

But we are removing this kind of behavior from Drupal 8, so I think it's important that we keep the names of variables closer to what they mean. In this case 'type' is indicating what type of list we were generating. I had changed the variable name to 'list_type' in the Twig template. I find that slightly more sensical than just 'tag'.

Here's an example of how the twig template would read using tag:

{% if items %}
<div class="item-list">
  {% if title is not empty -%}
    <h3>{{ title }}</h3>
  {% endif -%}
  {% if tag is ul %}
    <ul {{ attributes }}>
  {% else %}
    <ol {{ attributes }}>
  {% endif %}
  ...
{% endif %}

The above just doesn't read nicely to me. If we used list_type instead it makes a little more sense when you look at it:

{% if items %}
<div class="item-list">
  {% if title is not empty -%}
    <h3>{{ title }}</h3>
  {% endif -%}
  {% if list_type is ul %}
    <ul {{ attributes }}>
  {% else %}
    <ol {{ attributes }}>
  {% endif %}
    ...
{% endif %}
jenlampton’s picture

Title: Rename 'type' variable of theme_item_list() to 'tag' » Rename 'type' variable of theme_item_list() to 'list_type'
FileSize
4.73 KB
5.22 KB

Updating issue title. Rerolled patch with alternate variable name.

Status: Needs review » Needs work
Issue tags: -API clean-up, -Twig, -theme system cleanup

The last submitted patch, 1828536-drupal8-theme-item-list-type-tag.12.patch, failed testing.

jenlampton’s picture

Status: Needs work » Needs review
Issue tags: +API clean-up, +Twig, +theme system cleanup
jenlampton’s picture

retesting previous patch to confirm that I broke everything :/

dcam’s picture

FileSize
5.22 KB
590 bytes

I think I found the problem. One of the changes to "tag" wasn't changed to "list_type."

andymartha’s picture

FileSize
60.44 KB

After applying patch 1828536-16-list-type.patch in #16 from dcam, it appears that list items can be made/viewed with no errors using the alternate variable name. See screenshot.

Fabianx’s picture

Status: Needs review » Reviewed & tested by the community

Looks very good to me, passes tests, had manual testing. => RTBC

tim.plunkett’s picture

Status: Reviewed & tested by the community » Needs work

Missing changes to
core/modules/tour/lib/Drupal/tour/TourRenderController.php
core/modules/views/views.theme.inc

jibran’s picture

jibran’s picture

Issue summary: View changes

not tag

thedavidmeister’s picture

Assigned: sun » Unassigned

not sure this should still be assigned to sun. I see a few others rolling patches here.

thedavidmeister’s picture

Issue summary: View changes

added blocking issue

thedavidmeister’s picture

thedavidmeister’s picture

Assigned: thedavidmeister » Unassigned
Status: Needs work » Needs review
FileSize
7.1 KB
1.45 KB
star-szr’s picture

Status: Needs review » Needs work
Issue tags: +Needs change record

I just double checked the changes, looks good. Will need a change notification, tagging.

Minor coding standards nitpick, otherwise RTBC from me:

+++ b/core/modules/field/lib/Drupal/field/Plugin/views/field/Field.phpundefined
@@ -634,7 +634,7 @@ function render_items($items) {
+            'list_type' => $this->options['multi_type']

+++ b/core/modules/views/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.phpundefined
@@ -1698,7 +1698,7 @@ public function buildOptionsForm(&$form, &$form_state) {
+                  'list_type' => $type

+++ b/core/modules/views/lib/Drupal/views/Plugin/views/field/FieldPluginBase.phpundefined
@@ -873,7 +873,7 @@ public function buildOptionsForm(&$form, &$form_state) {
+                'list_type' => $type

+++ b/core/modules/views/lib/Drupal/views/Plugin/views/field/PrerenderList.phpundefined
@@ -83,7 +83,7 @@ function render_items($items) {
+            'list_type' => $this->options['type']

These should all have a trailing comma per https://drupal.org/coding-standards#array.

thedavidmeister’s picture

Status: Needs work » Needs review
FileSize
7.1 KB
3.06 KB

Status: Needs review » Needs work
Issue tags: -API clean-up, -Needs change record, -Twig, -theme system cleanup

The last submitted patch, 1828536-25.patch, failed testing.

star-szr’s picture

Status: Needs work » Needs review

#25: 1828536-25.patch queued for re-testing.

Status: Needs review » Needs work

The last submitted patch, 1828536-25.patch, failed testing.

star-szr’s picture

Status: Needs work » Needs review
Issue tags: +API clean-up, +Needs change record, +Twig, +theme system cleanup

#25: 1828536-25.patch queued for re-testing.

star-szr’s picture

Status: Needs review » Reviewed & tested by the community

Looks good to me!

alexpott’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs reroll

Needs a reroll

curl https://drupal.org/files/1828536-25.patch | git a
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  7273  100  7273    0     0   7424      0 --:--:-- --:--:-- --:--:--  9012
error: patch failed: core/modules/views/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php:1698
error: core/modules/views/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php: patch does not apply
error: patch failed: core/modules/views/lib/Drupal/views/Plugin/views/field/FieldPluginBase.php:873
error: core/modules/views/lib/Drupal/views/Plugin/views/field/FieldPluginBase.php: patch does not apply
error: patch failed: core/modules/views/lib/Drupal/views/Plugin/views/field/PrerenderList.php:83
error: core/modules/views/lib/Drupal/views/Plugin/views/field/PrerenderList.php: patch does not apply
error: patch failed: core/modules/views/views.theme.inc:1185
error: core/modules/views/views.theme.inc: patch does not apply
benjf’s picture

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

re-rolled

tstoeckler’s picture

+++ b/core/modules/views/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php
@@ -1695,12 +1695,11 @@ public function buildOptionsForm(&$form, &$form_state) {
-              $item_list = array(
-                '#theme' => 'item_list',
-                '#items' => $items,
-                '#type' => $type,
-              );
-              $output .= drupal_render($item_list);
+              $output .= theme('item_list',
+                array(
+                  'items' => $items,
+                  'list_type' => $type,
+                ));

+++ b/core/modules/views/lib/Drupal/views/Plugin/views/field/FieldPluginBase.php
@@ -870,12 +870,11 @@ public function buildOptionsForm(&$form, &$form_state) {
-            $item_list = array(
-              '#theme' => 'item_list',
-              '#items' => $items,
-              '#type' => $type,
-            );
-            $output .= drupal_render($item_list);
+            $output .= theme('item_list',
+              array(
+                'items' => $items,
+                'list_type' => $type,

+++ b/core/modules/views/lib/Drupal/views/Plugin/views/field/PrerenderList.php
@@ -79,13 +79,12 @@ function render_items($items) {
-        $item_list = array(
-          '#theme' => 'item_list',
-          '#items' => $items,
-          '#title' => NULL,
-          '#type' => $this->options['type'],
-        );
-        return drupal_render($item_list);
+        return theme('item_list',
+          array(
+            'items' => $items,
+            'title' => NULL,
+            'list_type' => $this->options['type'],

+++ b/core/modules/views/views.theme.inc
@@ -1185,16 +1185,14 @@ function theme_views_mini_pager($vars) {
-  $item_list = array(
-    '#theme' => 'item_list',
-    '#items' => $items,
-    '#title' => NULL,
-    '#type' => 'ul',
-    '#attributes' => array(
-      'class' => array('pager'),
-    ),
+  return theme('item_list',
+    array(
+      'items' => $items,
+      'title' => NULL,
+      'list_type' => 'ul',
+      'attributes' => array('class' => array('pager')),
...
-  return drupal_render($item_list);

These look like merge errors. Should be simply

- '#type' => $type,
+ '#list_type' => $type,

for each of them

thedavidmeister’s picture

Status: Needs review » Needs work
Issue tags: +Needs reroll

Yeah, #25 needs a re-re-roll without re-introducing theme() everywhere.

benjf’s picture

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

ok, thanks for the quick feedback! Hopefully this one is correct.

tstoeckler’s picture

Status: Needs review » Reviewed & tested by the community

Yup, that's it. Awesome response time!!! :-) Let's do it.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, rename-type-variable-1828536-35.patch, failed testing.

star-szr’s picture

Needs another quick reroll after #2010672: Rename 'type' variable of theme_mark to 'status' was committed. Thanks for all the rerolls @benjf!

thedavidmeister’s picture

Issue tags: +Needs reroll
pwieck’s picture

Assigned: Unassigned » pwieck

re-rolling now

pwieck’s picture

Assigned: pwieck » Unassigned
Status: Needs work » Needs review
FileSize
2.4 KB
6.47 KB

re-rolled to latest head

pwieck’s picture

Issue tags: -Needs reroll

#41 passed and ready for review or rework

thedavidmeister’s picture

Status: Needs review » Reviewed & tested by the community

The patch looks fine to me, but the interdiff is backwards I think.

alexpott’s picture

Title: Rename 'type' variable of theme_item_list() to 'list_type' » Change notice: Rename 'type' variable of theme_item_list() to 'list_type'
Priority: Normal » Critical
Status: Reviewed & tested by the community » Active

I've scanned the codebase for all usages of the item_list theme and everything appears to be updated correctly. This needs a change notice...

Committed 088b191 and pushed to 8.x. Thanks!

aspilicious’s picture

Category: bug » task

is a task

star-szr’s picture

Title: Change notice: Rename 'type' variable of theme_item_list() to 'list_type' » Rename 'type' variable of theme_item_list() to 'list_type'
Priority: Critical » Normal
Status: Active » Fixed
Issue tags: -Needs change record

Created a small change notification similar to the one for #2010672: Rename 'type' variable of theme_mark to 'status':

https://drupal.org/node/2030833

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

Anonymous’s picture

Issue summary: View changes

Updated issue summary.