Shortcodes do not work and throw sql errors


#1

I tried to integrate a gallery of the latest media uploads. I have the latest rtMedia release installed.

if i add[rtmedia_gallery global="true"] I would expect all media that is uploaded to be displayed. But the site breaks, there is no error message in apache's log / php log and the sites source stops immediately at

(bp-default-(child)-theme

My community has more than 30.000 pictures uploaded. Might this number of pictures be a problem for rtMedia shortcode / gallery?

Then I saw http://rtcamp.com/rtmedia/docs/common/shortcodes/gallery-shortcode/ and a user posted an example that was tried by myself, too: [rtmedia_gallery global="true" context="activity"]

Having a look into my server's error log I find this output including some sql errors when the page loads:

[Wed Sep 11 18:06:27 2013] [error] [client 93.104.86.175] WordPress-Datenbank-Fehler You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND wp_rt_rtm_media.media_type NOT IN ('album') AND (wp_rt_rtm_media.privacy is ' at line 1 f\xc3\xbcr Abfrage SELECT * FROM wp_rt_rtm_media where 2=2  AND wp_rt_rtm_media.activity_id IN  AND wp_rt_rtm_media.media_type NOT IN ('album') AND (wp_rt_rtm_media.privacy is NULL OR wp_rt_rtm_media.privacy=0 OR (wp_rt_rtm_media.privacy=20) OR (wp_rt_rtm_media.media_author=1 AND wp_rt_rtm_media.privacy>=40) OR (wp_rt_rtm_media.privacy=40 AND wp_rt_rtm_media.media_author IN ('34345'))) ORDER BY wp_rt_rtm_media.media_id desc LIMIT 0,10 von require('wp-blog-header.php'), require_once('wp-includes/template-loader.php'), include('/plugins/buddypress/bp-themes/bp-default/page.php'), the_content, apply_filters('the_content'), call_user_func_array, do_shortcode, preg_replace_callback, do_shortcode_tag, call_user_func, RTMediaGalleryShortcode::render, RTMediaTemplate->set_template, RTMediaTemplate->update_global_query, RTMediaQuery->query, RTMediaQuery->get_data, RTMediaQuery->populate_data, RTMediaQuery->populate_media, RTMediaModel->get_media, RTMediaModel->get  

[Wed Sep 11 18:06:27 2013] [error] [client 93.104.86.175] WordPress-Datenbank-Fehler You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND wp_rt_rtm_media.media_type NOT IN ('album') AND (wp_rt_rtm_media.privacy is ' at line 1 f\xc3\xbcr Abfrage SELECT * FROM wp_rt_rtm_media where 2=2 AND wp_rt_rtm_media.activity_id IN AND wp_rt_rtm_media.media_type NOT IN ('album') AND (wp_rt_rtm_media.privacy is NULL OR wp_rt_rtm_media.privacy=0 OR (wp_rt_rtm_media.privacy=20) OR (wp_rt_rtm_media.media_author=1 AND wp_rt_rtm_media.privacy>=40) OR (wp_rt_rtm_media.privacy=40 AND wp_rt_rtm_media.media_author IN ('34345'))) ORDER BY wp_rt_rtm_media.media_id desc von require('wp-blog-header.php'), require_once('wp-includes/template-loader.php'), include('/plugins/buddypress/bp-themes/bp-default/page.php'), the_content, apply_filters('the_content'), call_user_func_array, do_shortcode, preg_replace_callback, do_shortcode_tag, call_user_func, RTMediaGalleryShortcode::render, RTMediaTemplate->set_template, RTMediaTemplate->update_global_query, RTMediaQuery->query, RTMediaQuery->get_data, RTMediaQuery->populate_data, RTMediaQuery->populate_media, RTMediaModel->get_media, RTMediaModel->get

This just returns Oops !! There's no media found for the request !! at the place the shortcode is placed...

Can anyone help me out? What am I doing wrong? Seems if something is wrong...


#2

@quan - Looks like some issue has cropped up in the shortcode with the latest release or so. We are debugging this and it should be fixed in the next release.


#3