Can't set Approved status of media from Velocity script

Former Member
Former Member

I am trying to set media to approved after updating the media in a moderated forum, but the code is not working. Here's the code:

		#if (!$media.IsApproved)
            #set($mediaResponse = $core_v2_media.Update($galleryId, $mediaId, "%{ IsApproved = true }"))
        #end

...or is this a permissions issue, in which case I would need to use an automation as in the one in this post?

Parents Reply
  • Former Member
    0 Former Member in reply to Patrick M.

    After further investigation and looking in the database, I noticed that "IsApproved" is already true for all media awaiting moderation. The field that I should be concerned about is "IsHidden" which is true only for media awaiting moderation. So, I should be setting "IsHidden" to false. But I can't find a way to set "IsHidden" to false. The "Media" object has no settable "IsHidden" property.

    I am trying to prevent users from having every update to media being moderated in addition to the initial moderation.

Children