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.
Problem/Motivation
The @RestResource annotation in the EntityResource annotation class in core/modules/rest/src/Plugin/rest/resource/EntityResource.php has an @see after it. This is incorrect, see
https://www.drupal.org/node/1354#order
and it is causing the API module not to read it correctly.
Proposed resolution
Move the @see to before the annotation section.
Remaining tasks
Make a patch.
Comment | File | Size | Author |
---|---|---|---|
#11 | entity-see_docblock-2696919-11.patch | 723 bytes | snehi |
#7 | entity-see_docblock-2696919-7.patch | 667 bytes | chgasparoto |
annotation-formatting.png | 111.83 KB | mradcliffe |
Comments
Comment #2
drummLink to the page: https://api.drupal.org/api/drupal/core%21modules%21rest%21src%21Plugin%2...
Comment #3
jhodgdonCould we possibly put api.drupal.org back to what it was before this update broke the site?
Comment #4
drummI'm not sure that this is Prism-related. I'm not quite familiar enough with the annotation parsing to know what it should look like. That annotation is being rendered without code tags and isn't being processed by Prism.
Comment #5
drummhttps://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Field%21P... has a well-formatted annotation. I don't see much of a difference between the two documentation comments. Maybe the presence of the second paragraph, “
The 'Default' formatter is different…
” is the difference?Comment #6
jhodgdonAh. The problem is actually in the files. EntityResource has an @see after the annotation. The API module doesn't support that. EntityResource is violating the standard for order of docs elements in
https://www.drupal.org/node/1354#order
So moving this to a Core issue. Updated summary.
Comment #7
chgasparoto CreditAttribution: chgasparoto as a volunteer and at CI&T commentedComment #8
jhodgdonThanks! That should do it.
We should really have a Coder sniff for this...
Comment #10
jhodgdonWhoops, I guess the patch needs to be redone.
Comment #11
snehi CreditAttribution: snehi as a volunteer and at Publicis Sapient for Publicis Sapient commentedDone. Please review.
Comment #12
mradcliffeOh, good catch, @jhodgdon.
I also noticed the examples modules has the same issue so I'll create an issue in that queue too.
Patch looks good now.
Comment #13
jhodgdonThanks, that patch looks fine and applies.
Still not sure if we should have a code sniffer for this... and setting issue back to 8.0 since it can go into any 8.x branch.
Comment #17
catchCommitted/pushed to all three 8.x branches, thanks!
Added review credit post-commit.