Skip to content

Commit

Permalink
fir uplaoder param in gallery shortcode database error
Browse files Browse the repository at this point in the history
  • Loading branch information
Ritesh-patel committed Mar 23, 2015
1 parent 94428fd commit 1ff5054
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
9 changes: 7 additions & 2 deletions app/main/controllers/template/RTMediaTemplate.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,15 +120,20 @@ function set_template( $template = false, $shortcode_attr = false ) {
$rtaccount = 0;
}
//add_action("rtmedia_before_media_gallery",array(&$this,"")) ;
if ( isset( $shortcode_attr[ 'attr' ] ) && isset( $shortcode_attr[ 'attr' ][ 'uploader' ] ) && $shortcode_attr[ 'attr' ][ 'uploader' ] == "before" ){
$include_uploader = false;
if ( isset( $shortcode_attr[ 'attr' ] ) && isset( $shortcode_attr[ 'attr' ][ 'uploader' ] ) ){
$include_uploader = $shortcode_attr[ 'attr' ][ 'uploader' ];
unset( $shortcode_attr[ 'attr' ][ 'uploader' ] );
}
if ( $include_uploader == "before" ){
echo RTMediaUploadShortcode::pre_render( $shortcode_attr[ 'attr' ] );
}
echo "<div class='rtmedia_gallery_wrapper'>";
$this->add_hidden_fields_in_gallery();
$gallery_template = apply_filters( "rtmedia-before-template", $template, $shortcode_attr );
include $this->locate_template( $gallery_template );
echo "</div>";
if ( isset( $shortcode_attr[ 'attr' ] ) && isset( $shortcode_attr[ 'attr' ][ 'uploader' ] ) && ( $shortcode_attr[ 'attr' ][ 'uploader' ] == "after" || $shortcode_attr[ 'attr' ][ 'uploader' ] == "true" ) ){
if ( $include_uploader == "after" || $include_uploader == "true" ){
echo RTMediaUploadShortcode::pre_render( $shortcode_attr[ 'attr' ] );
}
} else {
Expand Down
8 changes: 8 additions & 0 deletions app/main/routers/query/RTMediaQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,14 @@ function &query( $query ) {
}
}
}

/*
* in gallery shortcode with uploader set to true, $this->is_gallery_shortcode won't be set for very first time and hence
* will miss the check for "$this->query['uploader']"
*/
if( isset( $this->query['uploader'] ) ){
unset( $this->query['uploader'] );
}
}

if ( isset ( $this->query[ "context" ] ) && $this->query[ "context" ] == "activity" ){
Expand Down

0 comments on commit 1ff5054

Please sign in to comment.