Move classes out of the preprocess functions and into the Twig templates. Use the addClass() attribute method to add classes in the template. Use the clean_class filter to filter class names, if necessary. Maintain all existing functionality and ensure all existing class names are still in the markup, even ones that are inherited.

See the following issues for more detailed examples:
#2217731: Move field classes out of preprocess and into templates
#2254153: Move node classes out of preprocess and into templates

See this change record for information about using the addClass() method:
https://www.drupal.org/node/2315471

See this change record for more information about the phase 1 process of moving class from preprocess to templates:
https://www.drupal.org/node/2325067

Preprocess Functions Modified

template_preprocess_aggregator_item
template_preprocess_aggregator_summary_item
template_preprocess_aggregator_feed_source

Twig Templates Modified

aggregator-item.html.twig
aggregator-summary-item.html.twig
aggregator-feed-source.html.twig

Files: 
CommentFileSizeAuthor
#3 2329819-3.patch1.82 KBCottser
FAILED: [[SimpleTest]]: [PHP 5.4 MySQL] Unable to apply patch 2329819-3.patch. Unable to apply patch. See the log in the details link for more information. View

Comments

davidhernandez’s picture

Issue tags: +FUDK
Cottser’s picture

Assigned: Unassigned » Cottser
Cottser’s picture

Assigned: Cottser » Unassigned
Status: Active » Needs review
FileSize
1.82 KB
FAILED: [[SimpleTest]]: [PHP 5.4 MySQL] Unable to apply patch 2329819-3.patch. Unable to apply patch. See the log in the details link for more information. View

I think this is about all we can do here.

davidhernandez’s picture

Agreed. It would probably be needless complex to try to move the classes, since they are being added as part of a link, and the summary item template probably rarely gets touched by a themer. What page displays the summary items? I'm having trouble finding it, but wanted to try something. Short of any good idea, I'm just waiting for it to pass the bot.

Cottser’s picture

Luckily we've had to test most of this stuff before :) I would take a look at #1987390: aggregator.module - Convert theme_ functions to Twig for testing steps. Thanks for taking a look!

lauriii’s picture

Status: Needs review » Reviewed & tested by the community

There's no more classes that could easily be moved to templates so I'm happy with this. Also the moved classes seems to work as supposed to.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 3: 2329819-3.patch, failed testing.

lauriii’s picture

Status: Needs work » Closed (duplicate)
Cottser’s picture

Agreed!