Squeezebox trouble after updates

  • Posts: 154
  • Thank you received: 4
9 years 1 month ago #232860

-- HikaShop version -- : 2.6.1
-- Joomla version -- : 3.4.8
-- PHP version -- : 5.6

dear team,

we did the joomla update from 2.5 to 3.4 and all respective extension updates, hikashop as well. so far we managed to fix all old broker hika layouts, thanks to your help. next issues that came up were some trouble with adding/changing the address in the checkout process. this is where we discovered, that even though you claim 2.6.1 is mootools-free, and even though we changed the popup mode in the backend to "vex" (= what is this anyway? we cannot use bootstrap so we thought this might be some alternative?) we get the following javascript errors:

on "HOME"

ReferenceError: Hash is not defined
modal.js (line 7, col 7444)

TypeError: window.addEvent is not a function
do_nothing( function() {
test.bo...ik.de (line 45, col 4)

TypeError: SqueezeBox is undefined
checkout (line 199, col 4)

...upon checking with firebug, they are all related to "squeezebox", even though disabled as stated above...

this is being loaded into the source code:

jQuery(function($) {
	SqueezeBox.initialize({});
	SqueezeBox.assign($('a.modal').get(), {
		parse: 'rel'
	});
});
function jModalClose() {
	SqueezeBox.close();
}
do_nothing( function() {
	SqueezeBox.initialize({});
	SqueezeBox.assign($$('a.modalizer_link,a.modal,a.modalizer'), {
		parse:'rel'
	});
})
;

on "ONLINE SHOP"

NO ERRORS AT ALL
NO EXTRA SCRIPTS

on "CHECKOUT"

ReferenceError: Hash is not defined
modal.js (line 7, col 7444)

TypeError: SqueezeBox is undefined
checkout (line 199, col 4)

...if compared to "HOME" one error less, but here much move hika-js is being loaded...


Part of the message is hidden for the guests. Please log in or register to see it.


any idea/help on this issue?

thanks in advance and best regards,
dee

Last edit: 9 years 1 month ago by olivnewton.

Please Log in or Create an account to join the conversation.

  • Posts: 83672
  • Thank you received: 13545
  • MODERATOR
9 years 1 month ago #232862

Hi,

When I look at the HTML of the page on your checkout, the only reference to squeezeBox in the HTML comes from the images of the products in the cart display where there is a popup when you click on the product image:
take.ms/nIZh8
That code is not in HikaShop by default (the product images are not clickable by default in the cart) and is something that you added yourself to the file "cart" of the view "checkout" via the menu Display>Views.

Please Log in or Create an account to join the conversation.

  • Posts: 154
  • Thank you received: 4
9 years 1 month ago #232927

must be a remain from an old hikamodule override. cannot remember adding this, will try to remove it. thanks!
but how do you exmplain it on HOME & ONLINE-SHOP?
could not find any squeezebox links in there, but squeezebox is still being loaded!

Part of the message is hidden for the guests. Please log in or register to see it.

Please Log in or Create an account to join the conversation.

  • Posts: 83672
  • Thank you received: 13545
  • MODERATOR
9 years 1 month ago #232972

Hi,

Then something must be initializing the modal library on these pages without using it.
On the home page, the only thing that is loaded in the CSS and the JS main files of HikaShop. And there is nothing displayed by HikaShop. So that means that a system plugin of HikaShop must be triggered and it loads the main library of HikaShop to do some processing.
But by doing that, there is no reason that the modal library would be loaded by HikaShop. HikaShop only loads it when it needs it.
So I'm guessing that there must be something else on your website loading it.

And looking at the order of the CSS and JS files in the header, it indicates that there something loading the modal library before the HikaShop library is loaded. So it can't come from HikaShop. It has to be something else on your website.

Please Log in or Create an account to join the conversation.

  • Posts: 154
  • Thank you received: 4
9 years 1 month ago #233264

i found out that the NoNumber modalizer plugin is installed, as well as JCEmediabox. disabled both, all errors on the home page are gone, but still persist in all hikashop pages. this time not only in /online-shop, but also on all product listings and overviews... i cant find a reason for this. maybe disabling one of the above mentioned causing this now?

Please Log in or Create an account to join the conversation.

  • Posts: 83672
  • Thank you received: 13545
  • MODERATOR
9 years 1 month ago #233269

Hi,

The error you get is because the popup modal system is loaded but mootools is removed and thus it's missing some pieces when it tries to initialize itself.

I think I know why you get the modal system loaded when it shouldn't.
Try to change the line:
if($redirect=='ask_user' || hikashop_loadUser() == null){
to:
if($redirect=='ask_user' || $config->get('enable_wishlist') && hikashop_loadUser() == null){

in the file administrator/components/com_hikashop/helpers/cart.php
Without that change, regardless of whether the wishlist system is used or not, the system always loads the modal library if the user is not logged in in order to tell him that he needs to login before adding the product to the wishlist when using the add to wishlist button.
Doing that change will make it so that the modal library is only loaded when the wishlist system is activated and that the user is not logged in.

Please Log in or Create an account to join the conversation.

  • Posts: 154
  • Thank you received: 4
9 years 1 month ago #233334

so this is something you missed to implement in order to be "mootools"-free?
the change would be obviously a hika-hack, would you include this on the next update?
i thought you are using a mootools-free modal library anyway, or at least there is an option to do so.
correct me if i am wrong, but i thought i read somewhere that the newest version is supposed to be totally mootools free?

PS. sorry, i tried the above but the error is still on all hika pages present, the following scripts get still loaded regardless me disabling NoNumber Modals, JCE Media Box and the included fix of yours in cart.php ...

from line 149 onwards inside the source code of /online-shop:

<script type="text/javascript">

				jQuery(document).ready(function (){
					jQuery('select').chosen({"disable_search_threshold":10,"allow_single_deselect":true,"placeholder_text_multiple":"Select some options","placeholder_text_single":"Select an option","no_results_text":"No results match"});
				});
			
		jQuery(function($) {
			SqueezeBox.initialize({});
			SqueezeBox.assign($('a.modal').get(), {
				parse: 'rel'
			});
		});
		function jModalClose() {
			SqueezeBox.close();
		}
<!--

	function hikashopModifyQuantity(id,obj,add,form,type,moduleid){

Last edit: 9 years 1 month ago by olivnewton.

Please Log in or Create an account to join the conversation.

  • Posts: 83672
  • Thank you received: 13545
  • MODERATOR
9 years 1 month ago #233337

Well, yes. The person who implemented the change on our end to add the "you need to be logged in to add products to your wishlist" popup notice forgot a check and the person who tested the mootools-free didn't see the issue as he must have been logged in.
It would obviously be included on the next update yes.
And no, the new version is not supposed to be mootools-free actually.
We still use it in a number of places. However, we now only load it when needed.

If that change doesn't help, then I don't see why that would come from HikaShop.
The only place where we could load the modal system is there:
JHTML::_('behavior.modal');
it's the line just below the check.
Try to remova that line and see if that helps. If not, then there modal library isn't loaded by HikaShop from what I can see.

The best in that case will be to edit the file libraries/cms/html/behavior.php and add such code:
echo '<pre>',print_r(debug_backtrace(),1),'</pre>';
after the line:
JHtml::_('script', 'system/modal.js', true, true);

That's what is loading the modal system in Joomla and that code will provide the call stack leading to that so you/we will be able to know what loads it.

Last edit: 9 years 1 month ago by nicolas.

Please Log in or Create an account to join the conversation.

  • Posts: 154
  • Thank you received: 4
9 years 1 month ago #233790

that worked! thanks!

next problem appearing:
if you visit this page
Part of the message is hidden for the guests. Please log in or register to see it.
and click on the product image, a modal without mootools appears, all working great!

if you add this product to cart, then click on the cart (on the right a module called (WARENKORB, with the link "Warenkorb / Zur Kasse") you see the product image under the column "PRODUKT". if you click on it no modal opens, instead the image is opened on a new tab AND if you check the source code, again here are the squeezebox errors present!

must be another place to remove the before mentioned line?

Last edit: 9 years 1 month ago by olivnewton.

Please Log in or Create an account to join the conversation.

  • Posts: 83672
  • Thank you received: 13545
  • MODERATOR
9 years 1 month ago #233792

Please Log in or Create an account to join the conversation.

  • Posts: 154
  • Thank you received: 4
9 years 1 week ago #236671

FYI or anybody having the same problem with the product image on the cart:
change in the override of checkout>cart.php
around line 300 to the following:

<div class="hikashop_cart_product_image_thumb" >
<?php echo $this->image->display($image->file_path,false,$image->file_name,'style="margin-top:10px;margin-bottom:10px;display:inline-block;vertical-align:middle"', '', $width, $height); ?>
</div>
in order to work i changed ...display($image->file_path,false,$image->file_name...
"false" was originally set to "true" (not by me) and this was causing the modal to be displayed and trying to load mootools again...

Last edit: 9 years 1 week ago by olivnewton.

Please Log in or Create an account to join the conversation.

  • Posts: 154
  • Thank you received: 4
9 years 1 week ago #236677

now proceeding to the next step in the cart, "add address" we get again the same squeezebox errors.
what files do we need to change?
we have overrides for "checkout" for the following files:
address.php
address_view.php
step.php
cart.php
login.php
payment.php

Please Log in or Create an account to join the conversation.

  • Posts: 83672
  • Thank you received: 13545
  • MODERATOR
9 years 1 week ago #236738

Hi,

From what I can see on your checkout, there are two possible causes for that:
1. You've configured the "address selector" setting of the HikaShop configuration to "popup" and thus it uses the popup system of mootools.
2. You have old overrides of address and address_view which uses the popup system of mootools. Removing them would solve that in that case.

Please Log in or Create an account to join the conversation.

  • Posts: 154
  • Thank you received: 4
9 years 1 week ago #237132

changed "address selector" to "dropdown list" and removed the overrides of "address" and "address_view" in checkout frontend. problem still there...

Please Log in or Create an account to join the conversation.

  • Posts: 83672
  • Thank you received: 13545
  • MODERATOR
9 years 1 week ago #237136

Hi,

I've checked the page there but I don't see anything which uses the mootools popups.

The best in that case will be to edit the file libraries/cms/html/behavior.php and add such code:
echo '<pre>',print_r(debug_backtrace(),1),'</pre>';
after the line:
JHtml::_('script', 'system/modal.js', true, true);

That's what is loading the modal system in Joomla and that code will provide the call stack leading to that so you/we will be able to know what loads it.

Please Log in or Create an account to join the conversation.

  • Posts: 154
  • Thank you received: 4
9 years 1 week ago #237333

thanks for trying to help so far!

it was a bit difficult to run the debug_backtrace as it always lead to an fatal error, so i had to allocate more RAM to the account. after finally it completed, i got 20MB of data inside the <pre>tags. i compressed it to 2MB.
Part of the message is hidden for the guests. Please log in or register to see it.


maybe you can see the reason for the problem? additionally i can also help to find a hint if you give me some instructions, as i never did this before.

Please Log in or Create an account to join the conversation.

  • Posts: 83672
  • Thank you received: 13545
  • MODERATOR
9 years 1 week ago #237335

Hi,

That's great. It's exactly what we need. If you can provide the same thing next time you find another problem with the mootools popup, we'll be able to directly tell you what to do.

Add the code:

$config = hikashop_config();
		$address_selector = (int)$config->get('checkout_address_selector', 0);
		if(empty($address_selector))
before the line:
JHTML::_('behavior.modal');
in the file components/com_hikashop/views/checkout/view.html.php
in order to load the modal system only when the popup selector is selected.
We'll also add that on our end for the next version.

Please Log in or Create an account to join the conversation.

  • Posts: 154
  • Thank you received: 4
9 years 1 week ago #237543

we are getting there!

next errors:

1 .after selecting the only one delivery method and clicking "next", on step-3 (payment method) i get the following error:



2. when selecting the payment method and clicking "next", nothing happens (except the same error as before shows up on the console), only after clicking on "next" again for the second time

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 83672
  • Thank you received: 13545
  • MODERATOR
9 years 1 week ago #237545

Hi,

Well, the selection system for payment methods uses mootools javascript. So it's normal that you get that error if you remove mootools.

Try changing the code:

$js.="
});

var ccHikaErrors = new Array();
ccHikaErrors [3] = '".JText::_('CREDIT_CARD_INVALID')."';
ccHikaErrors [5] = '".JText::_('CREDIT_CARD_EXPIRED')."';
";
to:
$js="

var ccHikaErrors = new Array();
ccHikaErrors [3] = '".JText::_('CREDIT_CARD_INVALID')."';
ccHikaErrors [5] = '".JText::_('CREDIT_CARD_EXPIRED')."';
";
in the file components/com_hikashop/views/checkout/view.html.php and that will remove the javascript using mootools on the payment methods selection area.

Please Log in or Create an account to join the conversation.

  • Posts: 154
  • Thank you received: 4
9 years 6 days ago #237733

did that, error gone, but now new one:

Attachments:

Please Log in or Create an account to join the conversation.

Time to create page: 0.101 seconds
Powered by Kunena Forum