Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Chi created an issue. See original summary.

minakshiPh’s picture

Status: Active » Needs review
FileSize
743 bytes

Added the patch with fix.

Kindly review.
Thanks!

Chi’s picture

Issue tags: +english

Well, I just realized that this might not be a typo though it sounds strange. "Delete" stands for HTTP method name in this context. I would like someone with more English experience to review this.

Wim Leers’s picture

Status: Needs review » Reviewed & tested by the community

Yep, this makes sense. Thanks!

Chi’s picture

I would like to emphasize that we are not deleting anything in that line. :)

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed 5233c3d to 8.3.x and 7a2da64 to 8.2.x. Thanks!

  • alexpott committed 5233c3d on 8.3.x
    Issue #2815063 by minakshiPh: Typo in EntityResource::delete()
    

  • alexpott committed 7a2da64 on 8.2.x
    Issue #2815063 by minakshiPh: Typo in EntityResource::delete()
    
    (cherry...
Chi’s picture

Status: Fixed » Needs work

Still thinking the spelling is wrong. Delete is not a verb here. It is kind of adjective describing the response method (GET, POST, OPTIONS, etc). We are not deleting responses here but only noting why this response has an empty body. I propose using uppercase for the method name like follows: "DELETE responses have an empty body."

Let me know if I am mistaken.

Wim Leers’s picture

Status: Needs work » Reviewed & tested by the community
Issue tags: +needs revert

Ugh, you're totally right. I don't know how I missed that :(

It should just have been s/Delete/DELETE/

alexpott’s picture

Status: Reviewed & tested by the community » Fixed
Issue tags: -needs revert

Let's just open an new issue for that. The bit that was changed was not the delete part. Reverting is totally OTT for this.

Wim Leers’s picture

Status: Fixed » Reviewed & tested by the community

Ehm, no, the original sentence made sense. The new sense makes no sense at all. Again, my bad :(

+++ b/core/modules/rest/src/Plugin/rest/resource/EntityResource.php
@@ -263,7 +263,7 @@ public function delete(EntityInterface $entity) {
-      // Delete responses have an empty body.
+      // Delete responses which have an empty body.
       return new ModifiedResourceResponse(NULL, 204);

"DELETE responses" have an empty body -> makes sense!

"Delete responses which have an empty body" -> makes no sense, because this code is not deleting any responses.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 2: fix-issue-2815063-2.patch, failed testing.

lomasr’s picture

I agree with Wim. "DELETE responses" have an empty body is a better idea . Added a patch.

shruti1803’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 14: fix-issue-2815063-14.patch, failed testing.

shruti1803’s picture

Status: Needs review » Needs work

The last submitted patch, 17: fix-issue-2815063-17.patch, failed testing.

yogeshmpawar’s picture

Status: Needs work » Needs review
FileSize
745 bytes

I have rerolled the patch against 8.3.x because #17 failed to apply.

Chi’s picture

Issue summary: View changes

I would not use quotes in this case for the purpose of consistency. We are usually not using them in this context. See EntityResource::delete method documentation as an example.

Chi’s picture

Issue summary: View changes
leeotzu’s picture

Changes applied as per suggestion from @chi for 8.3.x

leeotzu’s picture

Chi’s picture

The method name can remain in upper case.

Grayside’s picture

All caps for HTTP method names are standard practice in formal tech writing.

leeotzu’s picture

Updated the method name to uppercase.

Chi’s picture

Status: Needs review » Reviewed & tested by the community

  • catch committed 1f1f20f on 8.3.x
    Issue #2815063 by leeotzu, shruti1803, minakshiPh, lomasr, Yogesh Pawar...

  • catch committed 5ea0495 on 8.2.x
    Issue #2815063 by leeotzu, shruti1803, minakshiPh, lomasr, Yogesh Pawar...
catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed/pushed to 8.3.x and cherry-picked to 8.2.x. Thanks!

Status: Fixed » Closed (fixed)

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