diff --git a/README.md b/README.md index 70ff3f11c..6a2029df6 100644 --- a/README.md +++ b/README.md @@ -151,6 +151,12 @@ https://www.youtube.com/watch?v=dJrykKQGDcs ## Changelog ## +### 4.7.1 + +* FIXED + * Fixed a critical error related to inline annotations on certain themes. + * Resolved shimmering issue for newly uploaded media on the BuddyPress Groups page when GoDAM is active. + ### 4.7.0 * ENHANCEMENTS diff --git a/app/assets/js/godam-integration.js b/app/assets/js/godam-integration.js index f30b940d6..cb5299c4f 100644 --- a/app/assets/js/godam-integration.js +++ b/app/assets/js/godam-integration.js @@ -62,7 +62,8 @@ document.addEventListener('DOMContentLoaded', () => { initializePopupVideos(); } - if (node.classList?.contains('activity')) { + // Check for either 'activity' or 'groups' class. + if (node.classList?.contains('activity') || node.classList?.contains('groups')) { setTimeout(() => safeGODAMPlayer(node), 100); } } diff --git a/app/assets/js/godam-integration.min.js b/app/assets/js/godam-integration.min.js index 6d059872d..5a0727ecf 100644 --- a/app/assets/js/godam-integration.min.js +++ b/app/assets/js/godam-integration.min.js @@ -1 +1 @@ -const safeGODAMPlayer=(e=null)=>{try{return e&&1===e.nodeType&&e.isConnected?GODAMPlayer(e):GODAMPlayer(),!0}catch(e){return!1}};safeGODAMPlayer();let popupInitTimeout=null;const initializePopupVideos=()=>{clearTimeout(popupInitTimeout),popupInitTimeout=setTimeout((()=>{const e=document.querySelector(".mfp-content");if(e){e.querySelectorAll("video").length>0&&(safeGODAMPlayer(e)||safeGODAMPlayer())}}),200)};document.addEventListener("DOMContentLoaded",(()=>{safeGODAMPlayer();new MutationObserver((e=>{for(const t of e)for(const e of t.addedNodes)if(1===e.nodeType){const t=e.classList?.contains("mfp-content")||e.querySelector?.(".mfp-content"),o="VIDEO"===e.tagName||e.querySelector?.("video");(t||o&&e.closest(".mfp-content"))&&initializePopupVideos(),e.classList?.contains("activity")&&setTimeout((()=>safeGODAMPlayer(e)),100)}})).observe(document.body,{childList:!0,subtree:!0}),"undefined"!=typeof $&&$.magnificPopup&&($(document).on("mfpOpen mfpChange",(()=>{initializePopupVideos()})),$(document).on("mfpOpen",(()=>{setTimeout(initializePopupVideos,500)})))})); \ No newline at end of file +const safeGODAMPlayer=(e=null)=>{try{return e&&1===e.nodeType&&e.isConnected?GODAMPlayer(e):GODAMPlayer(),!0}catch(e){return!1}};safeGODAMPlayer();let popupInitTimeout=null;const initializePopupVideos=()=>{clearTimeout(popupInitTimeout),popupInitTimeout=setTimeout((()=>{const e=document.querySelector(".mfp-content");if(e){e.querySelectorAll("video").length>0&&(safeGODAMPlayer(e)||safeGODAMPlayer())}}),200)};document.addEventListener("DOMContentLoaded",(()=>{safeGODAMPlayer();new MutationObserver((e=>{for(const t of e)for(const e of t.addedNodes)if(1===e.nodeType){const t=e.classList?.contains("mfp-content")||e.querySelector?.(".mfp-content"),o="VIDEO"===e.tagName||e.querySelector?.("video");(t||o&&e.closest(".mfp-content"))&&initializePopupVideos(),(e.classList?.contains("activity")||e.classList?.contains("groups"))&&setTimeout((()=>safeGODAMPlayer(e)),100)}})).observe(document.body,{childList:!0,subtree:!0}),"undefined"!=typeof $&&$.magnificPopup&&($(document).on("mfpOpen mfpChange",(()=>{initializePopupVideos()})),$(document).on("mfpOpen",(()=>{setTimeout(initializePopupVideos,500)})))})); \ No newline at end of file diff --git a/app/main/RTMedia.php b/app/main/RTMedia.php index 2efc61ff6..f5018232c 100755 --- a/app/main/RTMedia.php +++ b/app/main/RTMedia.php @@ -1267,7 +1267,7 @@ public function enqueue_scripts_styles() { 'rtmedia-emoji-picker', ), RTMEDIA_VERSION, - args: true + true ); } else { wp_enqueue_script( diff --git a/app/main/controllers/template/rtmedia-functions.php b/app/main/controllers/template/rtmedia-functions.php index a2c53b6b7..f919646c9 100644 --- a/app/main/controllers/template/rtmedia-functions.php +++ b/app/main/controllers/template/rtmedia-functions.php @@ -593,23 +593,20 @@ function rtmedia_media( $size_flag = true, $echo = true, $media_size = 'rt_media // Check if Godam plugin is active. if ( defined( 'RTMEDIA_GODAM_ACTIVE' ) && RTMEDIA_GODAM_ACTIVE ) { $html .= do_shortcode( '[godam_video id="' . esc_attr( $rtmedia_media->media_id ) . '"]' ); + } elseif ( empty( $youtube_url ) ) { + $html .= sprintf( + '', + esc_url( ! empty( $rtmedia_media->cover_art ) ? $rtmedia_media->cover_art : '' ), + esc_url( wp_get_attachment_url( $rtmedia_media->media_id ) ), + $size_attr, + esc_attr( $rtmedia_media->id ) + ); } else { - // Fallback to native or YouTube player. - if ( empty( $youtube_url ) ) { - $html .= sprintf( - '', - esc_url( $rtmedia_media->cover_art ?: '' ), - esc_url( wp_get_attachment_url( $rtmedia_media->media_id ) ), - $size_attr, - esc_attr( $rtmedia_media->id ) - ); - } else { - $html .= sprintf( - '', - esc_attr( $rtmedia_media->id ), - esc_url( $youtube_url ) - ); - } + $html .= sprintf( + '', + esc_attr( $rtmedia_media->id ), + esc_url( $youtube_url ) + ); } $html .= ''; @@ -997,7 +994,7 @@ function rtmedia_delete_allowed() { global $rtmedia_media; $flag = false; - if ( $rtmedia_media !== null && isset( $rtmedia_media->media_author ) ) { + if ( null !== $rtmedia_media && isset( $rtmedia_media->media_author ) ) { $flag = intval( $rtmedia_media->media_author ) === get_current_user_id(); } if ( ! $flag && isset( $rtmedia_media->context ) && 'group' === $rtmedia_media->context && function_exists( 'bp_group_is_admin' ) ) { @@ -1025,7 +1022,7 @@ function rtmedia_edit_allowed() { global $rtmedia_media; $flag = false; - if ( $rtmedia_media !== null && isset( $rtmedia_media->media_author ) ) { + if ( null !== $rtmedia_media && isset( $rtmedia_media->media_author ) ) { $flag = intval( $rtmedia_media->media_author ) === get_current_user_id(); } if ( ! $flag ) { @@ -1482,13 +1479,13 @@ function rmedia_single_comment( $comment, $count = false, $i = false ) { if ( defined( 'RTMEDIA_GODAM_ACTIVE' ) && RTMEDIA_GODAM_ACTIVE ) { global $wpdb; - // Replace all