Jump to content

problem with the images in the gallery after updating to 4.3


levsha

Recommended Posts

Hello!

I had a problem with the images in the gallery after upgrading to 4.3.3.
Help solve the problem.
On the main page, the block of the latest images of the gallery, I click any preview. I get an error message.

I turn to the gallery, click on the preview image, I also receive an error message ..

https://forum.kamfishing.ru

https://forum.kamfishing.ru/index.php?/gallery/image/9287-продам-даунригер-8-9147821750/

SELECT COUNT(*) FROM `ibf_gallery_images` AS `gallery_images` WHERE image_album_id=354 AND image_id<>9287 AND image_= IS NULL
IPS\Db\Exception: 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 'IS NULL' at line 1 (1064)
#0 /var/www/forum.kamfishing/data/www/forum.kamfishing.ru/system/Db/Select.php(378): IPS\_Db->preparedQuery('SELECT COUNT(*)...', Array, true)
#1 /var/www/forum.kamfishing/data/www/forum.kamfishing.ru/system/Db/Select.php(440): IPS\Db\_Select->runQuery()
#2 /var/www/forum.kamfishing/data/www/forum.kamfishing.ru/system/Db/Select.php(361): IPS\Db\_Select->rewind()
#3 /var/www/forum.kamfishing/data/www/forum.kamfishing.ru/applications/gallery/sources/Image/Image.php(897): IPS\Db\_Select->first()
#4 /var/www/forum.kamfishing/data/www/forum.kamfishing.ru/applications/gallery/sources/Image/Image.php(1031): IPS\gallery\_Image->fetchNextOrPreviousImages(1, 'ASC')
#5 /var/www/forum.kamfishing/data/www/forum.kamfishing.ru/uploads/template_23_dd7fa6b771626a3f041bfec4dc0472c8_view.php(3383): IPS\gallery\_Image->prevItem(NULL)
#6 /var/www/forum.kamfishing/data/www/forum.kamfishing.ru/system/Theme/SandboxedTemplate.php(58): IPS\Theme\Cache\class_gallery_front_view->imageLightboxFrame(Object(IPS\gallery\Image))
#7 /var/www/forum.kamfishing/data/www/forum.kamfishing.ru/uploads/template_23_dd7fa6b771626a3f041bfec4dc0472c8_view.php(2544): IPS\Theme\_SandboxedTemplate->__call('imageLightboxFr...', Array)
#8 /var/www/forum.kamfishing/data/www/forum.kamfishing.ru/uploads/template_23_dd7fa6b771626a3f041bfec4dc0472c8_view.php(2544): IPS\Theme\SandboxedTemplate->imageLightboxFrame(Object(IPS\gallery\Image))
#9 /var/www/forum.kamfishing/data/www/forum.kamfishing.ru/system/Theme/SandboxedTemplate.php(58): IPS\Theme\Cache\class_gallery_front_view->imageLightbox(Object(IPS\gallery\Image), '\n<div data-cont...')
#10 /var/www/forum.kamfishing/data/www/forum.kamfishing.ru/applications/gallery/modules/front/gallery/view.php(321): IPS\Theme\_SandboxedTemplate->__call('imageLightbox', Array)
#11 /var/www/forum.kamfishing/data/www/forum.kamfishing.ru/applications/gallery/modules/front/gallery/view.php(321): IPS\Theme\SandboxedTemplate->imageLightbox(Object(IPS\gallery\Image), '\n<div data-cont...')
#12 /var/www/forum.kamfishing/data/www/forum.kamfishing.ru/system/Dispatcher/Controller.php(96): IPS\gallery\modules\front\gallery\_view->manage()
#13 /var/www/forum.kamfishing/data/www/forum.kamfishing.ru/system/Content/Controller.php(50): IPS\Dispatcher\_Controller->execute()
#14 /var/www/forum.kamfishing/data/www/forum.kamfishing.ru/applications/gallery/modules/front/gallery/view.php(61): IPS\Content\_Controller->execute()
#15 /var/www/forum.kamfishing/data/www/forum.kamfishing.ru/system/Dispatcher/Dispatcher.php(146): IPS\gallery\modules\front\gallery\_view->execute()
#16 /var/www/forum.kamfishing/data/www/forum.kamfishing.ru/index.php(13): IPS\_Dispatcher->run()
#17 {main}

 


Column image_ in the ibf_gallery_images table does not exist.

 

Link to comment
Share on other sites

I modified the code to workaround this. I figured someone else would report and get it fixed in a patch, but based on the time it looks like you discovered it around the same time as my members did. Anyway, if it's an option for you to modify the code, this is what I did:

  • Open <root>/applications/gallery/sources/Image/Image.php
  • Go to line 896, comment it out:
//$where['date']        = array( static::$databasePrefix . $sortBy . '= ?', $this->$sortBy );

That creates another issue.

  • Go to line 912, comment it out
  • Replace it with and save the file:
//foreach( \IPS\gallery\Image::getItemsWithPermission( $where, static::$databasePrefix . $sortBy . ' ' . $direction . ', image_id ' . $direction, NULL ) as $image )

foreach( \IPS\gallery\Image::getItemsWithPermission( $where, NULL, NULL) as $image)

Based on the code it looks like you lose something involving sorting, but I'd rather have missing functionality than a broken Gallery.

Link to comment
Share on other sites

Thank you!
Another revealed an error, Gallery can not rearrange previews of images ... shows error 2S106 / 1

I think these problems are connected.
I wrote another request for technical support to specialists, if I can not solve the problem, I will eliminate it as I wrote khawkins

Link to comment
Share on other sites

  • 2 weeks later...
On ‎5‎/‎24‎/‎2018 at 7:19 AM, newbie LAC said:

Hello,

- Revert your changes

- Go to album page https://forum.kamfishing.ru/index.php?/gallery/album/354-разное/

- Click on Manage album

- Click on Edit Album

- Select Default sort order

- Click on Save

Or run sql-query 


UPDATE gallery_albums SET album_sort_options='updated' WHERE album_sort_options IS NULL OR album_sort_options='';

 

just came across this error on some of my members albums, ran the sql query and all sorted now

thank you

Link to comment
Share on other sites

  • 2 weeks later...
  • 9 months later...

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...