Comments

donquixote’s picture

Is there any reason not to?
The argument was that most themes do not have classes (other than tests), but does it hurt to enable PSR-0 autoloading for those that do have classes?

Crell’s picture

The theme system is scheduled to be gutted by a series of sprints starting this weekend. We may want to wait until then to spend more time on this. Certainly IF a theme is going to include classes, they should be PSR-0-loaded, no question. Whether or not it will, we don't know yet.

berdir’s picture

In regards to tests, the latest patch of #1477218: Convert Tracker tests to PSR-0 / PSR-0 test class discovery now registers the namespace for everything living in {system}.

sun’s picture

Title: Decide whether to autoregister theme "lib" directories as PSR-0 roots for Drupal\$theme namespace » Register lib/ directories of themes as PSR-0 roots for Drupal\$theme namespace

I don't think this needs much discussion. Themes won't be "PHP-less" anytime soon, so it would be very strange to not support class autoloading for themes for no apparent reason.

Niklas Fiekas’s picture

Isn't this "works as designed" via #3, then?

sun’s picture

Issue tags: +Needs tests

#3 was about tests only.

However, looking at system_list(), it's possible that this already works. We should add a test to confirm that.

Niklas Fiekas’s picture

Status: Active » Needs review
Issue tags: -Needs tests
StatusFileSize
new1.3 KB

Something like this then, probably?

sun’s picture

Status: Needs review » Reviewed & tested by the community

Yup :)

catch’s picture

Issue tags: -PSR-0

#7: 1538478-theme-class-loading-7.patch queued for re-testing.

Status: Reviewed & tested by the community » Needs work
Issue tags: +PSR-0

The last submitted patch, 1538478-theme-class-loading-7.patch, failed testing.

Niklas Fiekas’s picture

Status: Needs work » Needs review
StatusFileSize
new1.4 KB

Reroll.

Status: Needs review » Needs work

The last submitted patch, 1538478-theme-class-loading-11.patch, failed testing.

Niklas Fiekas’s picture

Status: Needs work » Needs review
StatusFileSize
new519 bytes
new1.4 KB

Oh ... failed properly rerolling. It's test_theme, not theme_test.

aspilicious’s picture

Status: Needs review » Reviewed & tested by the community

Thank you :)

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed to 8.x. Thanks!

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

Anonymous’s picture

Issue summary: View changes

Updated issue summary.