Closed (fixed)
Project:
Drupal core
Version:
8.6.x-dev
Component:
file.module
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
5 Mar 2018 at 17:18 UTC
Updated:
22 May 2018 at 08:49 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
wim leersComment #3
tstoecklerComment #4
owenbush commentedLooking at this at DrupalCon Nashville.
Comment #5
owenbush commentedI have added a message to the forbidden AccessResult call which details that only file owners can update or delete file entities.
Comment #6
owenbush commentedNeeds review.
Comment #8
josephdpurcell commentedLooking at the failed tests, this looks a similar state to https://www.drupal.org/project/drupal/issues/2950125#comment-12570703
The tests that are failing should be updated with the new error message you've set.
Comment #9
owenbush commentedThanks for that. I have updated the test case. I've provided a new patch and an interdiff.
Comment #10
owenbush commentedComment #12
owenbush commentedI guess in this instance it should be a DELETE type, so I added that to the test case. Attached is new patch and a new interdiff.
Comment #13
owenbush commentedComment #14
borisson_I'm not sure about
andhere.I think
update or delete the file entityis a better description, because you can't update and delete at the same time.Comment #15
yogeshmpawarComment #16
yogeshmpawarAgree with #14 comment it should be
update or delete the file entityrather thanupdate and delete the file entityso added updated patch with an interdiff.Comment #17
Anonymous (not verified) commentedOne of the implicit, but important point of @borisson_ is:
The title of issue also comply with this order.
The code check with this order (PATCH is 'update').
if ($method === 'PATCH' || $method == 'DELETE') {Therefore it will be good if the message will also comply with this order.
Also we use strict compare, so:
Comment #18
yogeshmpawarComment #19
yogeshmpawarAgree with @vaplas, but currently adding only strict compare for "DELETE" method. Interdiff is also added.
Comment #20
msankhala commentedHere is updated patch as per code review suggestions.
Comment #21
Anonymous (not verified) commentedLooks nice!
Comment #22
wim leers😍👍 Perfect!
Comment #23
alexpottI'm not sure the comment adds anything anymore because it's now part of the code too. But I guess this doesn't really matter.
Creditting @Wim Leers and @vaplas for reviews.
Comment #24
alexpottCommitted ec8b4f8 and pushed to 8.6.x. Thanks!
Comment #26
wim leersCreated #2971277: FileTest::testPatchIndividual() and FileTest::testDeleteIndividual() failing on 8.6 to update JSON API's test coverage accordingly.