Skip to content

Commit f47258c

Browse files
authored
Merge pull request #2236 from rtCamp/develop
Version update v4.7.7
2 parents 60d674e + d654e5e commit f47258c

30 files changed

+489
-226
lines changed

Gruntfile.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ module.exports = function (grunt) {
1212
tasks: ['shell:postcss']
1313
},
1414
js: {
15-
files: ['app/assets/js/rtMedia.js', 'app/assets/admin/js/scripts.js'],
15+
files: ['app/assets/js/rtMedia.js', 'app/assets/admin/js/scripts.js', 'app/assets/admin/js/settings.js'],
1616
tasks: ['terser']
1717
}
1818
},
@@ -60,7 +60,10 @@ module.exports = function (grunt) {
6060
},
6161
backend: {
6262
files: {
63-
'app/assets/admin/js/admin.min.js': ['app/assets/admin/js/scripts.js']
63+
'app/assets/admin/js/admin.min.js': [
64+
'app/assets/admin/js/scripts.js',
65+
'app/assets/admin/js/settings.js'
66+
]
6467
}
6568
},
6669
godam: {

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,17 @@ https://www.youtube.com/watch?v=dJrykKQGDcs
151151

152152
## Changelog ##
153153

154+
### 4.7.7
155+
156+
* FIXED
157+
* Fix JS Build process breaking Admin dashboard.
158+
* Fix rtMedia compatibility with Hello Elementor theme.
159+
* Fix Masonry script issue in rtMedia Gallery in BuddyX theme.
160+
161+
* ENHANCEMENT
162+
* Enhanced End to End playwright testing scripts for media validation.
163+
* Improved rtMedia Logo visibility on dashboard.
164+
154165
### 4.7.6
155166

156167
* FIXED

app/admin/RTMediaAdmin.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -777,13 +777,15 @@ public function ui( $hook ) {
777777

778778
$admin_ajax = admin_url( 'admin-ajax.php' );
779779

780+
// Always enqueue tabs.js as it's a dependency for admin scripts (provides rtTab jQuery plugin).
781+
wp_enqueue_script( 'rtmedia-admin-tabs', RTMEDIA_URL . 'app/assets/admin/js/vendors/tabs.js', array( 'backbone' ), RTMEDIA_VERSION, true );
782+
780783
/* Only one JS file should enqueue */
781784
if ( '' === $suffix ) {
782-
wp_enqueue_script( 'rtmedia-admin-tabs', RTMEDIA_URL . 'app/assets/admin/js/vendors/tabs.js', array( 'backbone' ), RTMEDIA_VERSION, true );
783-
wp_enqueue_script( 'rtmedia-admin-scripts', RTMEDIA_URL . 'app/assets/admin/js/scripts.js', array( 'backbone' ), RTMEDIA_VERSION, true );
785+
wp_enqueue_script( 'rtmedia-admin-scripts', RTMEDIA_URL . 'app/assets/admin/js/scripts.js', array( 'rtmedia-admin-tabs', 'backbone' ), RTMEDIA_VERSION, true );
784786
wp_enqueue_script( 'rtmedia-admin', RTMEDIA_URL . 'app/assets/admin/js/settings.js', array( 'backbone', 'wp-util' ), RTMEDIA_VERSION, true );
785787
} else {
786-
wp_enqueue_script( 'rtmedia-admin', RTMEDIA_URL . 'app/assets/admin/js/admin.min.js', array( 'backbone', 'wp-util' ), RTMEDIA_VERSION, true );
788+
wp_enqueue_script( 'rtmedia-admin', RTMEDIA_URL . 'app/assets/admin/js/admin.min.js', array( 'rtmedia-admin-tabs', 'backbone', 'wp-util' ), RTMEDIA_VERSION, true );
787789
}
788790

789791
// Enqueue JS file for GoDAM notice show/hide.
-527 Bytes
Loading

app/assets/admin/js/admin.min.js

Lines changed: 1 addition & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/assets/admin/js/rtmedia-admin.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/assets/admin/js/settings.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1066,11 +1066,15 @@ jQuery( document ).ready( function ( $ ) {
10661066
jQuery('.rtm-button-container.top').append( setting_message );
10671067
setting_message.delay( 3000 ).fadeOut( 100 );
10681068
}
1069+
// Return early for import/export settings responses to avoid JSON.parse on already-parsed object.
1070+
return;
10691071
}
10701072

10711073
if ( typeof data.error === 'undefined' ) {
1072-
1073-
data = JSON.parse( data );
1074+
// Only parse if data is a string (not already parsed by jQuery).
1075+
if ( typeof data === 'string' ) {
1076+
data = JSON.parse( data );
1077+
}
10741078
if ( data.exceed_size_msg ) {
10751079
jQuery( '#debuglog' ).val( '' );
10761080
alert( data.exceed_size_msg );

app/assets/js/admin-upload-terms.min.js

Lines changed: 1 addition & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/assets/js/rtMedia.js

Lines changed: 29 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -342,9 +342,9 @@ jQuery("document").ready(function ($) {
342342
"get_single_activity_content" === get_action ||
343343
"activity_get_older_updates" === get_action) &&
344344
"undefined" !== typeof rtmedia_masonry_layout &&
345-
"true" === rtmedia_masonry_layout &&
345+
rtm_is_true(rtmedia_masonry_layout) &&
346346
"undefined" !== typeof rtmedia_masonry_layout_activity &&
347-
"true" === rtmedia_masonry_layout_activity
347+
rtm_is_true(rtmedia_masonry_layout_activity)
348348
) {
349349
setTimeout(function () {
350350
apply_rtMagnificPopup(
@@ -1066,9 +1066,9 @@ jQuery("document").ready(function ($) {
10661066
// Masonry code for activity
10671067
if (
10681068
typeof rtmedia_masonry_layout != "undefined" &&
1069-
rtmedia_masonry_layout == "true" &&
1069+
rtm_is_true(rtmedia_masonry_layout) &&
10701070
typeof rtmedia_masonry_layout_activity != "undefined" &&
1071-
rtmedia_masonry_layout_activity == "true"
1071+
rtm_is_true(rtmedia_masonry_layout_activity)
10721072
) {
10731073
// Arrange media into masonry view
10741074
rtmedia_activity_masonry();
@@ -1083,9 +1083,9 @@ jQuery("document").ready(function ($) {
10831083
"get_single_activity_content" === get_action ||
10841084
"activity_get_older_updates" === get_action) &&
10851085
typeof rtmedia_masonry_layout != "undefined" &&
1086-
rtmedia_masonry_layout == "true" &&
1086+
rtm_is_true(rtmedia_masonry_layout) &&
10871087
typeof rtmedia_masonry_layout_activity != "undefined" &&
1088-
rtmedia_masonry_layout_activity == "true"
1088+
rtm_is_true(rtmedia_masonry_layout_activity)
10891089
) {
10901090
rtmedia_activity_masonry();
10911091
}
@@ -1094,7 +1094,7 @@ jQuery("document").ready(function ($) {
10941094
// Masonry code
10951095
if (
10961096
typeof rtmedia_masonry_layout != "undefined" &&
1097-
rtmedia_masonry_layout == "true" &&
1097+
rtm_is_true(rtmedia_masonry_layout) &&
10981098
jQuery(".rtmedia-container .rtmedia-list.rtm-no-masonry").length == 0
10991099
) {
11001100
rtm_masonry_container = jQuery(".rtmedia-container .rtmedia-list");
@@ -1191,7 +1191,7 @@ jQuery("document").ready(function ($) {
11911191

11921192
if (
11931193
"undefined" !== typeof rtmedia_masonry_layout &&
1194-
"true" === rtmedia_masonry_layout
1194+
rtm_is_true(rtmedia_masonry_layout)
11951195
) {
11961196
rtm_masonry_reload(rtm_masonry_container);
11971197
}
@@ -1232,6 +1232,16 @@ function bp_media_create_element(id) {
12321232
return false;
12331233
}
12341234

1235+
/**
1236+
* Check if a value is true (handles both string "true" and boolean true).
1237+
*
1238+
* @param {*} value The value to check.
1239+
* @return {boolean} True if the value is "true" (string) or true (boolean).
1240+
*/
1241+
function rtm_is_true(value) {
1242+
return "true" === value || true === value;
1243+
}
1244+
12351245
function rtmedia_version_compare(left, right) {
12361246
if (typeof left + typeof right != "stringstring") {
12371247
return false;
@@ -1270,7 +1280,17 @@ function rtm_is_element_exist(el) {
12701280
function rtm_masonry_reload(el) {
12711281
setTimeout(function () {
12721282
// We make masonry recalculate the element based on their current state.
1273-
el.masonry("reload");
1283+
// Check if masonry instance exists and use the appropriate method.
1284+
var masonryInstance = el.data('masonry');
1285+
if (masonryInstance) {
1286+
// Masonry v4.x uses reloadItems() + layout() instead of reload()
1287+
if (typeof masonryInstance.reload === 'function') {
1288+
el.masonry("reload");
1289+
} else if (typeof masonryInstance.reloadItems === 'function') {
1290+
masonryInstance.reloadItems();
1291+
masonryInstance.layout();
1292+
}
1293+
}
12741294
}, 250);
12751295
}
12761296

app/assets/js/rtmedia.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)