Task

Convert the following theme functions to use the new table #type:

Module Theme function name Where in Code What is it really?
aggregator theme_aggregator_categorize_items function form table

Related issues

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

joelpittet’s picture

Assigned: Unassigned » joelpittet
Status: Active » Needs review
FileSize
3.64 KB

Added a @todo about the classes

        // @todo add this this the second column: 'class' => array('categorize-item'),
        // @see http://drupal.org/node/1876712#comment-7156742

I have a feeling that if we used #rows instead of child elements(like normal #theme=>table expects, we could do this cell attributes but it will skip "drupal_pre_render_table", it may also not work with the form api but that's just a guess...

ParisLiakos’s picture

Status: Needs review » Needs work
+++ b/core/modules/aggregator/aggregator.pages.incundefined
@@ -242,11 +238,33 @@ function aggregator_categorize_items($items, $feed_source = '') {
+        $categories = $form['categories'][$key];
+        unset($form['categories'][$key]);
...
+        $form['items'][$key]['categories'] = $categories;

I dont understand why we need $categories variable here and unset()?

+++ b/core/modules/aggregator/aggregator.pages.incundefined
@@ -242,11 +238,33 @@ function aggregator_categorize_items($items, $feed_source = '') {
+        // @todo add this this the second column: 'class' => array('categorize-item'),
+        // @see http://drupal.org/node/1876712#comment-7156742

I think this class is not used anywhere so you can easily just kill it here.

joelpittet’s picture

Status: Needs work » Needs review
FileSize
3.08 KB
4.66 KB

Cell class killed. Refactored the loops a bit and removed the unset()/$categories shuffling.

Also, not sure if this is a bug or intended functionality but when you unselect two categories, it rechecks the "automatically checked category" (which is fair enough but it would make sense on the create state to do this and if manual changes are made they are respected over the automatic). And weirder yet, if you uncheck the "auto" category and check the "non-auto" and hit save, it decides that you are wrong and checks only the "auto" category. If that doesn't sound right to other people I will open another issue for that.

joelpittet’s picture

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

On second look, I may have broken something along the way... this may need some tests for the above functionality.

joelpittet’s picture

Status: Needs work » Needs review

Well I did further testing and now it seems to be working as expected, so weird, may still need tests though. Thoughts?

ParisLiakos’s picture

There are already tests for this one..it is just that an item inherits category from its feed
This seems a lot better..

Just one thing

+++ b/core/modules/aggregator/aggregator.pages.incundefined
@@ -211,42 +211,48 @@ function _aggregator_page_list($items, $op, $feed_source = '') {
+  if ($items) {
+    $form_items = entity_view_multiple($items, 'default');
+
+    if (!empty($form_items)) {

lets make this one line: if ($items && $form_items = entity_view_multiple($items, 'default'))

jibran’s picture

Made the changes as per #6 removing tag as per above comment.

jibran’s picture

Issue tags: +Novice
FileSize
831 bytes
4.58 KB

Minor indentation fix. Added Novice tag as per meta.

ParisLiakos’s picture

Status: Needs review » Reviewed & tested by the community

Seems good to me and testbot agrees

catch’s picture

Status: Reviewed & tested by the community » Fixed

Looks great. Committed/pushed to 8.x.

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

Anonymous’s picture

Issue summary: View changes

Updated issue summary.

joelpittet’s picture

Assigned: joelpittet » Unassigned
Issue summary: View changes