Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Updated: Comment 0
Problem/Motivation
While working with the ControllerBase I realized that config return an unexpected value.
Proposed resolution
Remaining tasks
User interface changes
API changes
Related Issues
Comment | File | Size | Author |
---|---|---|---|
#5 | controller-2089195-FAIL.patch | 2.11 KB | dawehner |
#5 | controller-2089195-PASS.patch | 2.76 KB | dawehner |
#1 | controllerbase-2089195-1.patch | 662 bytes | dawehner |
Comments
Comment #1
dawehner.
Comment #2
pwolanin CreditAttribution: pwolanin commentedyes, simple fix.
Comment #3
webchickHm. Tests? :\
Comment #4
dawehnerI was indeed confused that alex refused some tests for https://drupal.org/node/2078285#comment-7859707
Comment #5
dawehnerSo here is a unit test, take it or drop it :)
Comment #6
dawehner#5: controller-2089195-FAIL.patch queued for re-testing.
Comment #7
BerdirYes, agreed that it makes sense. There are use cases where you need the config factory, but $this->config() should work the same way as Drupal::config().
Unit tests look fine to me, we can extend them for other methods if there's a problem later on.
Comment #8
andypost+1 to rtbc, this really need for complex controllers
Comment #9
alexpottCommitted a40399f and pushed to 8.x. Thanks!