#1119 – Error when filtering gallery

Status: Closed - Category: Showtime Image Gallery
Hi!
In version you sent me in ticket #1110 that fixed displaying selecting Showtime Gallery Layout, I found that when I want to filter galleries using Filter options in Administrator I get error:
0 Call to a member function load() on bool

Here is debug informations:
Hi Nikola,

I have just fixed that. If you can't wait for the update you can edit file /administrator/components/com_showtime/models/galleries.php and change line 108 from:
$category = Table::getInstance('Category', 'Table');

to:
$category = Table::getInstance('Category', '\\Joomla\\CMS\\Table\\');


Thank you for reporting this.

Regards
 
Thanks Lefteris! You provide fast and excellent support!

EDIT: I tried manually to change galleries.php file as you said but I get same result.
This code on line 108 works for me:

$category = Table::getInstance('Category', '\\Joomla\\CMS\\Table\\');

Hi Nikola,

Can you please verify that your changes have been saved? Because that change fixed the issue for me.
Line 108 should look like this in order to work:
$category = Table::getInstance('Category', '\\Joomla\\CMS\\Table\\');
 
It is not only line 108

Code should look like this:
$categoryTable = Table::getInstance('Category', '\\Joomla\\CMS\\Table\\');
			$categoryTable->load($categoryId);
			$query->where('category.lft >= ' . (int) $categoryTable->lft)->where('category.rgt <= ' . (int) $categoryTable->rgt);
		}


Check the video:
https://www.dropbox.com/scl/fi/ou657x77ai7cti7s31pd9/1114.mp4?rlkey=9t2pllflh2882y9xc0aoyskws&dl=0
Hi Nikola,

You are right, I used a wrong variable name in the code I provided. I just updated my previous replies to correct the code.
To summarize, the full working code is the following:
		if (is_numeric($categoryId))
		{
			$category = Table::getInstance('Category', '\\Joomla\\CMS\\Table\\');
			$category->load($categoryId);
			$query->where('category.lft >= ' . (int) $category->lft)->where('category.rgt <= ' . (int) $category->rgt);
		}


So, the only change that is really needed when compared to the current version is line 108:
$category = Table::getInstance('Category', '\\Joomla\\CMS\\Table\\');


Thank you very much for the feedback you have provided.


 
Great! Thank you.
This ticket is closed, therefore read-only. You can no longer reply to it. If you need to provide more information, please open a new ticket and mention this ticket's number.

Note: An active subscription is required in order to get support for our paid extensions. For our free extensions, if you don't have an account, register and then submit your support request.  In case you just want to ask a question, you can also use the contact form .

Note: Our support team is currently on vacation, so please anticipate slightly longer response times. Thank you for your understanding!

Firecoders
Are you using our extensions? Please post a review at the Joomla extensions directory!
Post a review