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.
Rest module currently attempts to interface with rest.yml, however config files must have not only a module namespace but a config name. This should become rest.resources.yml. Additionally, no default configuration is supplied, it is just written out on the first submission of its settings form. A default configuration file should be supplied representing the initial configuration state (even in this case where nothing should be enabled by default.)
Patch to come.
Comment | File | Size | Author |
---|---|---|---|
#10 | 1858676-rest-config-10.patch | 3.15 KB | gdd |
#9 | 1858676-rest-config.patch | 2.92 KB | Damien Tournoud |
#7 | rest.config.7.patch | 2.34 KB | sun |
#4 | 1858676-rest-config-4.patch | 2.34 KB | gdd |
#1 | 1858676-rest-config-1.patch | 1.71 KB | gdd |
Comments
Comment #1
gddWoop!
Comment #2
tstoecklerWon't the call to config return 'null' as a string, and, hence, cast to TRUE? I think we could just put an empty array directly in the default config and then kill the ternary completely. Considering that I've not spent that much time knee-deep in CMI yet, I'm probably missing something but I wanted to bring it up just in case.
Comment #4
gddIt helps if I convert the tests as well. This passes locally for me now.
As far as the YAML, this string null does actually convert to the value NULL as long as it isn't quoted, however I do agree that an empty array would probably be a better default value. I'm about to run but I'll get to that in a followup.
Comment #6
xjmI downloaded this patch and issue to look at offline.
Comment #7
sunThe only reason for the test failures seems to be the bogus default value for resources in the default config file.
Comment #9
Damien Tournoud CreditAttribution: Damien Tournoud commentedJust keeping the ball rolling. The config call in
Drupal\rest\EventSubscriber\RouteSubscriber
was not converted.Comment #10
gddLast patch was missing the default config file.
Comment #11
sunThanks + ouch @ #9... The good thing about procedural wrappers is that we can consistently grep the entire code base for existing instances — the more stuff we inject, the more inconsistent + ungreppable becomes our code base. :-/ I hope we'll be able to address this somehow prior to release.
Comment #12
xjmYep.
Comment #13
webchickCommitted and pushed to 8.x. Thanks!