Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VideoPress uploads as teacher fail #2128

Open
jom opened this issue Apr 23, 2018 · 3 comments
Open

VideoPress uploads as teacher fail #2128

jom opened this issue Apr 23, 2018 · 3 comments
Labels
[Pri] Low Cosmetic issue, low impact, easy workaround Third-Party [Type] Bug
Milestone

Comments

@jom
Copy link
Member

jom commented Apr 23, 2018

See #2128 (comment) for latest update.

Steps to Reproduce

  1. Activate and connect Jetpack with a Professional plan; activate the video storage feature.
  2. Log in as a teacher.
  3. Try to upload a video while editing a lesson.
  4. Video won't upload correctly and the user will immediately lose access if they view the media library.

What I Expected

Ability to insert videos uploaded via VideoPress into courses/lessons as a teacher.

What Happened Instead

Immediately lose access.

WordPress / Sensei version

Sensei 1.10.1
WP 4.9.5

Browser / OS version

Chrome

=======

VideoPress uploads videos and sets the attachment author to ID of 0. We are currently filtering all attachments to just those created by the teacher. One possible fix is in 0d91393, however there still seems to be some choppiness (need to refresh before inserting uploaded media).

@donnapep
Copy link
Collaborator

May not need to do anything here as it could be fixed by VideoPress. For reference - pxWta-N4-p2.

@donnapep donnapep added the [Pri] Low Cosmetic issue, low impact, easy workaround label Apr 26, 2018
@amroland
Copy link

Hi,
Is there any change in this issue?

Meanwhile, I tested it further:

A user with "Author" or "Contributor" role can see all uploaded videos, no matter who uploaded it. This is also a mistake. It would be better if all users would only see the video which they uploaded own.

"Teacher" role (with Sensei plugin) works well, because teachers can only see their own media (music, pdf, image) except the video. Unfortunately, they still can not see it.

I am waiting for your reply!

BR,
Roland

@mikeyarce
Copy link
Member

I tested this out today and found out that:

  • The uploads now do work for VideoPress
  • There is still a permission problem where the teacher can't view the uploaded VideoPress videos

I think it has to do with restrict_media_library_modal here

public function restrict_media_library_modal( $query = array() ) {

When a VideoPress video is uploaded, the author get's set to the Jetpack site owner ID, not the teacher id.

Maybe a good workaround would be:

  1. Hook into the videopress upload
  2. If it's a post_mime_type of video/videopress, add postmeta to set the teacher ID
  3. Add a check to restrict_media_library_modal to check for that postmeta

@donnapep donnapep added this to the 4.24.4 milestone Oct 23, 2024
@donnapep donnapep modified the milestones: 4.24.4, 4.24.5 Nov 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Pri] Low Cosmetic issue, low impact, easy workaround Third-Party [Type] Bug
Projects
None yet
Development

No branches or pull requests

5 participants