JQuery is not loaded while bootstrap is loaded

Phoca Photo - image gallery extension
Gruz
Phoca Enthusiast
Phoca Enthusiast
Posts: 61
Joined: 26 Dec 2008, 19:09
Location: Ukraine
Contact:

JQuery is not loaded while bootstrap is loaded

Post by Gruz »

I get an error at a PhocaPhoto page

Code: Select all

ReferenceError: jQuery is not defined
http://pyatka.in.uac/media/com_phocaphoto/bootstrap/js/bootstrap.min.js
Line 11
I belive it's logical to load jquery when loading bootstrap
I file

Code: Select all

components/com_phocaphoto/views/categories/view.html.php
In the code

Code: Select all

		JHTML::stylesheet('media/com_phocaphoto/css/style.css' );
		if ($this->t['load_bootstrap'] == 1) {
			JHTML::stylesheet('media/com_phocaphoto/bootstrap/css/bootstrap.min.css' );
			$document->addScript(JURI::root(true).'/media/com_phocaphoto/bootstrap/js/bootstrap.min.js');
		}
Add jquery load

Code: Select all

		JHTML::stylesheet('media/com_phocaphoto/css/style.css' );
		if ($this->t['load_bootstrap'] == 1) {
			JHtml::_('jquery.framework');
			JHTML::stylesheet('media/com_phocaphoto/bootstrap/css/bootstrap.min.css' );
			$document->addScript(JURI::root(true).'/media/com_phocaphoto/bootstrap/js/bootstrap.min.js');
		}
This fixes my problems

P.S. And the same change is needed for the category and item views.
Last edited by Gruz on 12 May 2016, 15:37, edited 1 time in total.
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47794
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: JQuery is not loaded while bootstrap is loaded

Post by Jan »

Hi, thank you very much for the info, I will fix it in next version.

Jan
If you find Phoca extensions useful, please support the project
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47794
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: JQuery is not loaded while bootstrap is loaded

Post by Jan »

Hi, should be OK in version 3.0.2
https://www.phoca.cz/news/1017-phoca-ph ... 2-released

Jan
If you find Phoca extensions useful, please support the project
Post Reply