Updated: Comment #N
Problem/Motivation
Follow up for #731724: Convert comment settings into a field to make them work with CMI and non-node entities
In comment admin paths we use comment-bundle as routing parameter.
This is of the form {entity_type}__{field_name} we then use this code:
list($entity_type, $field_name) = explode('__', $field_name, 2);
To get the two relevant parts.
We could do this with dynamic routing and make these arguments available in the routing attributes.
Proposed resolution
Add an enhancer that does this.
Remaining tasks
Patch
User interface changes
None
API changes
None
Related Issues
Follow-up from #731724: Convert comment settings into a field to make them work with CMI and non-node entities.
Comment | File | Size | Author |
---|---|---|---|
#13 | interdiff.txt | 1.67 KB | larowlan |
#13 | dynamic-routing-2098011.13.patch | 13.15 KB | larowlan |
#11 | interdiff.txt | 818 bytes | larowlan |
#11 | dynamic-routing-2098011.11.patch | 13.11 KB | larowlan |
#7 | interdiff.txt | 4.13 KB | larowlan |
Comments
Comment #1
andypostComment #2
larowlanWorking on this too.
Comment #3
larowlanHere tis, also adds new unit-test for the enhancer
Comment #5
larowlanShould fix tests.
Comment #6
jibranNice clean up. It is almost RTBC just minor things.
@param missing.
This seems like a good use of dataProvider.
Comment #7
larowlanFixes #6 and merges HEAD
Comment #9
larowlan#7: dynamic-routing-2098011.3.patch queued for re-testing.
Comment #10
jibranThank you @larowlan for the fixes :). Now we have more test ;). Clean code. I think it is api clean up.
Wow this is called beauty :D.
CommentManager is a typo :P. Please can we fix it on commit :$.
Comment #11
larowlanFixes typo
Comment #12
dawehnerCan we move it to the if() so that the bundles are not loaded on every routing request.
Just looking at this line I am wondering whether this is maybe too generic. Isn't there quite a high chance that someone will put also 'bundle' into the route and it will magically adds these values even not needed?
We are adding @group Drupal these days. I think it just makes sense.
Comment #13
larowlanisset($bundles[$defaults['bundle']])
@group Routing
as a few have that tooComment #14
dawehnerAt least this does not change the bundles variable.
Comment #15
alexpottCommitted 8caad96 and pushed to 8.x. Thanks!