#1119 Posted in ‘Showtime Image Gallery’

Latest post by Nikola Djuric on Wednesday, 15 November 2023 11:03 EET

Nikola Djuric
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:

Lefteris Kavadas
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

Nikola Djuric
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\\');

Lefteris Kavadas
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\\');

Nikola Djuric
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

Lefteris Kavadas
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.


Nikola Djuric
Great! Thank you.

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 .

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