- Open on Drupal.org →Environment: PHP 8.2 & MySQL 8last update
almost 2 years ago Not currently mergeable. - @yashrode opened merge request.
- last update
almost 2 years ago Custom Commands Failed - 🇮🇳India yash.rode pune
Implemented basic functionality, needs test coverage.
- last update
almost 2 years ago 29,398 pass - last update
almost 2 years ago 29,401 pass - 🇮🇳India yash.rode pune
📌 Revert and Delete actions should not be available for the current revision Active will be a blocker for this issue.
- 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺
Can you explain why 📌 Revert and Delete actions should not be available for the current revision Active must block this issue but did not block ✨ Add Block Content revision UI Fixed ? 🙏
- 🇮🇳India yash.rode pune
It is working for Block content so I am missing something, trying to find that.
- 🇬🇧United Kingdom AaronMcHale Edinburgh, Scotland
📌 Revert and Delete actions should not be available for the current revision Active doesn't actually have to block this issue.
The reason it didn't block ✨ Add Block Content revision UI Fixed is because in that issue the logic to remove the revert and delete button was added to the block content access handler, but I created 📌 Revert and Delete actions should not be available for the current revision Active because there's no reason that it can't be added to a generic access handler, since pretty much every implementation of the generic revision UI will need that same logic.
So not strictly a blocker, but it would be really nice if we could do it generically and not have the same code duplicated for each implementation.
- 🇮🇳India yash.rode pune
Yep, after looking at it more closely I came to the same conclusion that It is nice to have but not a blocker for this issue.
- last update
almost 2 years ago Custom Commands Failed - 🇮🇳India yash.rode pune
Still the access needs to be changed and test coverage for it.
- last update
almost 2 years ago Custom Commands Failed - last update
almost 2 years ago Custom Commands Failed - last update
almost 2 years ago 29,412 pass, 17 fail - last update
almost 2 years ago 29,417 pass, 17 fail - last update
almost 2 years ago 29,417 pass, 17 fail - last update
almost 2 years ago 29,417 pass, 17 fail - last update
almost 2 years ago 29,448 pass, 5 fail - last update
almost 2 years ago 29,450 pass, 1 fail - last update
almost 2 years ago 29,452 pass, 1 fail - last update
almost 2 years ago 29,452 pass, 1 fail - last update
almost 2 years ago 29,452 pass, 1 fail - last update
almost 2 years ago Custom Commands Failed - last update
almost 2 years ago 29,409 pass, 10 fail - last update
almost 2 years ago 29,461 pass - last update
almost 2 years ago 29,461 pass - Issue was unassigned.
- Status changed to Needs review
almost 2 years ago 11:49am 13 June 2023 - Status changed to Needs work
almost 2 years ago 3:03pm 13 June 2023 - 🇺🇸United States smustgrave
This seems in line with what we did for Block Content
Applying MR 4057 to 11.x and clearing cache I can confirm I'm seeing the revisions tab on media.
Created a few revisions and reverted back n forth with no issue.Test coverage also seems to fully cover the change.
Only thing missing we did for Block Content is add a change record.
- Status changed to Needs review
almost 2 years ago 5:58am 14 June 2023 - 🇦🇺Australia larowlan 🇦🇺🏝.au GMT+10
@yash the change notice shouldn't be published until the issue is merged, I've unpublished it. Thanks for creating it!
- Status changed to RTBC
almost 2 years ago 2:02pm 14 June 2023 - 🇺🇸United States smustgrave
Change record and everything else looks good to me!
- Status changed to Needs work
almost 2 years ago 3:34pm 14 June 2023 - 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺
There appears to be one BC break for JSON:API? If we can revert the JSON:API test change and the test still passes, then my only major concern would be addressed! 😊
- last update
almost 2 years ago 29,467 pass - Status changed to Needs review
almost 2 years ago 6:51am 15 June 2023 - Status changed to Needs work
almost 2 years ago 1:21pm 15 June 2023 - 🇺🇸United States smustgrave
Think the one open thread is legit. Needing those permissions for GET doesn't seem correct. The node module didn't need to grant access to the content page as a reference.
- last update
almost 2 years ago 29,491 pass, 2 fail - last update
almost 2 years ago 29,492 pass, 2 fail - last update
almost 2 years ago 29,500 pass, 2 fail - last update
almost 2 years ago 29,516 pass - Status changed to Needs review
almost 2 years ago 8:37am 19 June 2023 - Status changed to Needs work
almost 2 years ago 2:02pm 19 June 2023 - 🇺🇸United States smustgrave
How come we are editing the current access checking? I have a feeling this could impact existing sites if not configured in a specific way.
- Status changed to Needs review
almost 2 years ago 2:13pm 19 June 2023 - 🇮🇳India yash.rode pune
It won't cause any BC problem as there was already an early return for admin in upstream.
- 🇮🇳India yash.rode pune
I am not sure if we want to Allow admin permission to override all operations for revisions also?
- Status changed to RTBC
almost 2 years ago 4:15pm 20 June 2023 - 🇺🇸United States smustgrave
Lets see what the committers think. Don't think I can make that call.
- Status changed to Needs review
almost 2 years ago 5:44pm 20 June 2023 - 🇮🇳India yash.rode pune
I have a doubt about the permissions, do we need two if checks in the
\Drupal\media\MediaAccessControlHandler::checkAccess()
's view all revisions case? asking this because we don't have anything like that for block content but it was there in upstream for media. - 🇺🇸United States smustgrave
Will admit block content may need some tweaking itself. We just added granular permissions a few weeks ago.
- last update
almost 2 years ago 29,462 pass, 1 fail - last update
almost 2 years ago 29,491 pass, 12 fail - last update
almost 2 years ago 29,522 pass - Status changed to RTBC
almost 2 years ago 4:16pm 21 June 2023 - Status changed to Needs work
almost 2 years ago 3:59am 23 June 2023 - 🇦🇺Australia larowlan 🇦🇺🏝.au GMT+10
Left some comments on the MR, there's something awry with the permissions in my opinion
- Assigned to yash.rode
- last update
almost 2 years ago Custom Commands Failed - last update
almost 2 years ago 29,568 pass - last update
almost 2 years ago 29,568 pass - last update
almost 2 years ago 29,568 pass - last update
almost 2 years ago 29,568 pass - last update
almost 2 years ago Custom Commands Failed - last update
almost 2 years ago 29,568 pass - Issue was unassigned.
- Status changed to Needs review
almost 2 years ago 3:25pm 23 June 2023 - last update
almost 2 years ago 29,571 pass - Status changed to RTBC
almost 2 years ago 1:43pm 26 June 2023 - Status changed to Needs work
almost 2 years ago 3:55pm 26 June 2023 - 🇺🇸United States phenaproxima Massachusetts
This seems reasonably straightforward but could use some cleanup.
- last update
almost 2 years ago Custom Commands Failed - last update
almost 2 years ago Custom Commands Failed - last update
almost 2 years ago 29,475 pass, 20 fail - last update
almost 2 years ago Custom Commands Failed - last update
almost 2 years ago 29,576 pass - Status changed to Needs review
almost 2 years ago 4:13pm 27 June 2023 - last update
almost 2 years ago 29,576 pass - last update
almost 2 years ago 29,576 pass - Status changed to RTBC
almost 2 years ago 12:26pm 29 June 2023 - Status changed to Needs work
almost 2 years ago 9:48pm 29 June 2023 - 🇺🇸United States phenaproxima Massachusetts
I'm sorry, this isn't quite ready to go yet. There is still some stuff that could use clean-up and consistency; in particular, I'm not sure the functional test coverage is testing all the ins and outs that it should.
- Assigned to yash.rode
- last update
almost 2 years ago Custom Commands Failed - last update
almost 2 years ago 29,574 pass, 1 fail - last update
almost 2 years ago Custom Commands Failed - last update
almost 2 years ago Custom Commands Failed - last update
almost 2 years ago Custom Commands Failed - last update
almost 2 years ago Custom Commands Failed - last update
almost 2 years ago 29,583 pass - 🇺🇸United States phenaproxima Massachusetts
Shaping up! But I have more feedback. I'm not sure the functional test coverage is as robust as it should be, and it could still use some streamlining.
- last update
almost 2 years ago 29,818 pass - last update
almost 2 years ago 29,818 pass - Issue was unassigned.
- Status changed to Needs review
almost 2 years ago 1:23pm 3 July 2023 - Assigned to yash.rode
- Status changed to Needs work
almost 2 years ago 1:21pm 5 July 2023 - 🇮🇳India yash.rode pune
Got some idea about the default and latest, so giving it a shot.
- 🇺🇸United States phenaproxima Massachusetts
I discussed this today with @yash.rode and I think the thing I'm stuck on, at least for now, is: why are we borrowing access logic from Block Content?
Custom blocks are not meant to be viewed on their own. Media sort of is -- it's disabled by default, but they're not quite embedded things like blocks are. I feel like Node's access control logic is closer to what we'd want for media items, albeit without the complicated system of access grants.
To me, the logic we want is this, based on permissions:
If the operation is
view
, you can see the media if ANY of the following are true:- You have
view all media revisions
- You have
view any TYPE_ID media revisions
- You have
administer media
(this is already the case in HEAD)
If the operation is
revert
ordelete revision
, you can do the operation if either:- You have
revert any TYPE_ID media revisions
/delete any TYPE_ID media revisions
- You have
administer media
AND the media item in question is NOT the default revision. It's okay if it's the latest revision -- that ensures it plays nicely with Content Moderation, which has the concept of a newer, not-yet-published revision -- but you can't revert or delete the default revision, because that makes no sense. So, for example:
case 'revert': return AccessResult::allowedIfHasPermissions($account, [ 'revert any ' . $type . ' media revisions', 'administer media', ], 'OR') ->andIf($is_not_default_revision);
- You have
- Issue was unassigned.
- Status changed to Needs review
over 1 year ago 2:55pm 7 July 2023 - 🇮🇳India yash.rode pune
Then what about the logic that controls access to latest revision, for removing the revert and delete revision button 📌 Revert and Delete actions should not be available for the current revision Active . We need that for generic revision UI.
- 🇺🇸United States phenaproxima Massachusetts
Ooof! 🤯 🤬 What a maddening bug!
IMHO the correct thing to do is postpone this issue on getting that bug fixed. Chances are, the fix isn't too complicated to implement. I'd rather we did that than add confusing workarounds to this issue.
- Status changed to Postponed
over 1 year ago 10:54pm 9 July 2023 - Status changed to Needs work
over 1 year ago 8:33am 20 August 2023 - 🇫🇮Finland lauriii Finland
📌 Revert and Delete actions should not be available for the current revision Active has been committed.
- Assigned to yash.rode
- 🇮🇳India yash.rode pune
Rebasing and changing the
MediaAccessControlHandler
. - last update
over 1 year ago 30,013 pass, 1 fail - last update
over 1 year ago 30,073 pass - 🇨🇭Switzerland berdir Switzerland
> Then I think it'd be better to not have both Media::preSaveRevision() and BlockContent::preSaveRevision() achieve the same behavior using two very different method implementations and instead move that to EditorialContentEntityBase::preSaveRevision() RevisionLogEntityTrait::preSaveRevision().
We have an existing issue to standardize that, but it's been stuck on semantics/naming for years. This is not the issue for this and I don't think it should block it.
- 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺
@Berdir: TIL!
Then let's:
- link that issue and have that issue point to this as another example.
- at least ensure that
BlockContent::preSaveRevision()
andMedia::preSaveRevision()
are identical, to allow that issue to land more easily in the future. That way,Media::preSaveRevision()
needs to change only once.
- 🇨🇭Switzerland berdir Switzerland
📌 Automatically set revision user/log information/created time on entity revisions Needs work is the issue I talked about.
- last update
over 1 year ago 30,073 pass - last update
over 1 year ago 30,073 pass - last update
over 1 year ago 30,073 pass - Issue was unassigned.
- Status changed to Needs review
over 1 year ago 1:13pm 21 August 2023 - Assigned to yash.rode
- Status changed to Needs work
over 1 year ago 12:22pm 22 August 2023 - last update
over 1 year ago Build Successful - last update
over 1 year ago 30,069 pass, 2 fail - last update
over 1 year ago 30,072 pass, 2 fail - last update
over 1 year ago 30,073 pass - Issue was unassigned.
- Status changed to Needs review
over 1 year ago 6:57am 23 August 2023 - Status changed to Needs work
over 1 year ago 9:40am 23 August 2023 - 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺
AFAICT there's a security vulnerability/regression in here 😅
12:19 59:29 Running- last update
over 1 year ago 30,074 pass - 🇮🇳India yash.rode pune
I have few questions/doubts:
- Do we need to add revert all revisions
and delete all revisions
permissions like
node.permissions.yml
? - Do we need to care about the default and latest revision in this issue? Because, we were doing that before to remove the revert and delete buttons from default revision. We don't care about revision when it's a view revision operation.
Why to get rid of default and latest handling in this issue -> We are already doing that in 📌 Revert and Delete actions should not be available for the current revision Active
Thanks in advance.
- Do we need to add revert all revisions
and delete all revisions
permissions like
- Status changed to Needs review
over 1 year ago 8:38am 25 August 2023 - last update
over 1 year ago 30,153 pass - last update
over 1 year ago Custom Commands Failed - Status changed to Needs work
over 1 year ago 5:35pm 8 September 2023 - last update
over 1 year ago 30,167 pass - Status changed to Needs review
over 1 year ago 9:29am 13 September 2023 - 🇮🇳India yash.rode pune
- last update
over 1 year ago 30,175 pass - Status changed to Needs work
over 1 year ago 2:52pm 15 September 2023 - 🇺🇸United States phenaproxima Massachusetts
This is looking pretty good to me. The scope of changes is clear, and the test coverage is solid, although could use some clean-up in certain spots. But I took a long time to read all the way through this and I feel like I understand what we're trying to do.
- last update
over 1 year ago 30,181 pass - last update
over 1 year ago 30,181 pass - Status changed to Needs review
over 1 year ago 1:00pm 18 September 2023 - Status changed to RTBC
over 1 year ago 1:25pm 11 October 2023 - 🇺🇸United States smustgrave
So this one doesn't stall and maybe can land in 10.2!
Tested again by creating a Media object (Image bundle)
Editing the source file
Verified the revisions tab
Reverted back to the previous revision
Old image is used.
Deleted revision 2 jsut fine. - last update
over 1 year ago 30,409 pass - last update
over 1 year ago 30,414 pass - last update
over 1 year ago 30,414 pass - last update
over 1 year ago 30,432 pass 38:15 34:44 Running- last update
over 1 year ago 30,443 pass - last update
over 1 year ago 30,444 pass - last update
over 1 year ago 30,454 pass - last update
over 1 year ago 30,472 pass, 1 fail - last update
over 1 year ago 30,481 pass - First commit to issue fork.
- 🇮🇳India yash.rode pune
Addressed Ben's suggestions except one thread, which is not clear to me. Thanks for the review.
- last update
over 1 year ago 30,500 pass - Status changed to Needs work
over 1 year ago 3:50pm 1 November 2023 - 🇺🇸United States bnjmnm Ann Arbor, MI
Two remaining threads to address. The changes are straightforward enough that whoever makes them is welcome to self-RTBC this and get it back into committer consideration.
- 🇺🇸United States bnjmnm Ann Arbor, MI
This also needs an update hook for the entity defintion. I noticed this was added in some of the other Revision UI issues and wasn't sure why it was needed since updating the definition in the PHP class provided the expected functionality. The EntityDefinitionUpdateManagerInterface docs explain why, and there's are existing examples to work from and just swap in the media specific stuff.
- First commit to issue fork.
- Status changed to Needs review
over 1 year ago 12:22am 3 November 2023 - 🇦🇺Australia acbramley
Threads have been resolved, and more work has been done to fix other bugs. This needs a re-review.
- Status changed to RTBC
over 1 year ago 8:28pm 7 November 2023 - 🇺🇸United States smustgrave
Not sure I'm one that can mark this so apologize if I'm wrong
Followed the same steps as above
Tested again by creating a Media object (Image bundle)
Editing the source file
Verified the revisions tab
Reverted back to the previous revision
Old image is used.
Deleted revision 2 just fine.Seems all the threads have been resolved except maybe the deprecation of core/modules/media/media.routing.yml. But @acbramley makes a good point about it being needed.
Think this landing in 10.2 would be great.
- last update
over 1 year ago 30,510 pass - Status changed to Fixed
over 1 year ago 9:57am 8 November 2023 Automatically closed - issue fixed for 2 weeks with no activity.