Jump to content


Photo

view full image explodes


idate becomes image_date in the upgrader.
viewing an image in full(not lightbox nav) produces:
mySQL query error: SELECT image_id, image_caption, image_caption_seo, image_masked_file_name, image_directory, image_media, image_media_thumb, image_thumbnail FROM gallery_images WHERE image_album_id=7 AND ( image_approved=1 OR ( image_approved IN(-1,0,1) AND image_category_id IN( 1 ) ) ) ORDER BY idate asc
SQL error: Unknown column 'idate' in 'order clause'

Status: Fixed
Version: 5.0.0 Beta 1
Fixed In: 5.0.0 Beta 1


4 Comments

Photo
Marcher Technologies
Jul 27 2012 08:54 AM
//-----------------------------------------
// Fix sort key from older versions
// @link http://community.invisionpower.com/tracker/issue-36059-driver-error-when-trying-to-view-a-picture/
//-----------------------------------------
$order = ( $order == 'name' ) ? 'image_caption' : $order;
apparently so... gallery_image::fetchPhotoStrip... and eew this would hit everybody not ordering by image name in any single album upgrading.
//-----------------------------------------
// Fix sort key from older versions
// @link http://community.invisionpower.com/tracker/issue-36059-driver-error-when-trying-to-view-a-picture/
// @link http://community.invisionpower.com/resources/bugs.html/_/ip-gallery/view-full-image-explodes-r38401
//-----------------------------------------
$order = ( $order == 'name') ? 'image_caption'<img src='http://content.community.invisionpower.com/public/style_emoticons/<#EMO_DIR#>/sad.png' class='bbc_emoticon' alt=':(' />($order == 'idate') ? 'image_date' <img src='http://content.community.invisionpower.com/public/style_emoticons/<#EMO_DIR#>/sad.png' class='bbc_emoticon' alt=':(' />($order == 'rating') ? 'image_rating' <img src='http://content.community.invisionpower.com/public/style_emoticons/<#EMO_DIR#>/sad.png' class='bbc_emoticon' alt=':(' />($order == 'comments') ? 'image_comments' <img src='http://content.community.invisionpower.com/public/style_emoticons/<#EMO_DIR#>/sad.png' class='bbc_emoticon' alt=':(' />($order == 'views') ? 'image_views' : $order))));
either that, or fix it on upgrade in the db.
Photo
Marcher Technologies
Jul 27 2012 09:55 AM
and if I am not mistaken... that would likely be the better way to go, do it the once on upgrades as needed.
upg_50000 version_upgrade::rebuildAlbums :
right above:
$this->gallery->helper('image')->updatePermissionFromParent( $row );
adding:
//-----------------------------------------
// Fix sort key from older versions... do it the once and allow easier maintenance of the table changes
// @link http://community.invisionpower.com/tracker/issue-36059-driver-error-when-trying-to-view-a-picture/
// @link http://community.invisionpower.com/resources/bugs.html/_/ip-gallery/view-full-image-explodes-r38401
//-----------------------------------------
$options = @unserialize($row['album_sort_options']);
if($options!==false && $options['key'])
{
$options['key'] = ( $options['key'] == 'name') ? 'image_caption'<img src='http://content.community.invisionpower.com/public/style_emoticons/<#EMO_DIR#>/sad.png' class='bbc_emoticon' alt=':(' />($options['key'] == 'idate') ? 'image_date' <img src='http://content.community.invisionpower.com/public/style_emoticons/<#EMO_DIR#>/sad.png' class='bbc_emoticon' alt=':(' />($options['key'] == 'rating') ? 'image_rating' <img src='http://content.community.invisionpower.com/public/style_emoticons/<#EMO_DIR#>/sad.png' class='bbc_emoticon' alt=':(' />($options['key'] == 'comments') ? 'image_comments' <img src='http://content.community.invisionpower.com/public/style_emoticons/<#EMO_DIR#>/sad.png' class='bbc_emoticon' alt=':(' />($options['key'] == 'views') ? 'image_views' : $options['key']))));
$row['album_sort_options'] = serialize($options);
}
$options = false;
and adding an init:
$cycleDone = 0;
$options = false;
would likely do the job(sanely ensuring no albums decide to nab onto other albums settings) and allow removal of the code in fetchPhotoStrip being done on display.... and its growth by column changes.
Updating Fixed In to: 5.0.0 Beta 1
Updating Status to: Fixed

Seems we still need to run the update query to update gallery_albums - neither resync() nor updatePermissionsFromParents() updates the gallery albums table with the passed in data, but otherwise implemented both fixes to try to catch all cases.
    • Marcher Technologies likes this
Photo
Marcher Technologies
Jul 30 2012 07:34 PM

Seems we still need to run the update query to update gallery_albums - neither resync() nor updatePermissionsFromParents() updates the gallery albums table with the passed in data, but otherwise implemented both fixes to try to catch all cases.

Um, yeah, did not realize that or would have that query present in the code above... thanks, that would not go as well as planned considering there ;)