Installing leadingsystems/lsjs

Trotz automatischer Installation noch Fragen? Hier werden Sie beantwortet!

Installing leadingsystems/lsjs

Beitragvon tenzin » 19. Aug 2020, 07:47

Background:
Contao: 4.4.7
Merconis: 4.0.6
I have to delete and install my assets folder again by doing composer install.

Problem:
It installed leadingsystems/lsjs (v2.0.10) and this breaks my shop which is working fine with leadingsystems/lsjs (v2.0.8). How can I get v2.0.8.
tenzin
 
Beiträge: 33
Registriert: 9. Aug 2019, 09:47

Re: Installing leadingsystems/lsjs

Beitragvon supportteam2 » 19. Aug 2020, 11:10

Can you please elaborate on "breaks my shop"? How exactly is it broken after installing lsjs v.2.0.10? I'm asking because the contao extension "leadingsystems/contao-lsjs4c" (the component that integrates lsjs into contao) has probably been updated as well and I'm wondering whether it's actually lsjs or rather contao-lsjs4c that breaks your shop. Do you know what version of contao-lsjs4c was installed before doing the composer install and what version is installed now?

If you want to make sure that a specific version of leadingsystems/lsjs is installed, you have to add a requirement to contao's composer.json. By default lsjs is required indirectly by leadingsystems/contao-merconis which is why you can't see it in the contao manager and therefore can't define the required version there.

"leadingsystems/lsjs": "2.0.8"

If you know the version of leadingsystems/contao-lsjs4c that was installed before, you can also add a specific requirement for this component in the composer.json to make sure that this version is being installed again.
Ihr MERCONIS-Supportteam
Your MERCONIS Support Team
Benutzeravatar
supportteam2
 
Beiträge: 418
Registriert: 4. Mär 2015, 14:05

Re: Installing leadingsystems/lsjs

Beitragvon tenzin » 19. Aug 2020, 12:38

Sorry for not being precise, by broke, I meant to say. When I click add to cart button, it shows «Loading…» and stays so. In the console log there is an error saying «Uncaught TypeError: Cannot read property 'parentNode' of null». This error does not appear with the version 2.0.8.

leadingsystems/contao-lsjs4c version is 2.0.3
tenzin
 
Beiträge: 33
Registriert: 9. Aug 2019, 09:47

Re: Installing leadingsystems/lsjs

Beitragvon supportteam2 » 19. Aug 2020, 14:55

I think the best way to go is to make composer install both leadingsystems/lsjs and leadingsystems/contao-lsjs4c with the previous versions. Therefore, please add the requirements to contao's composer.json and start the update process in the contao manager. You can start a dry run to see if the contao manager (i.e. composer) actually downgrades to the versions you want. If it does, you can actually run the update process and then see if lsjs works again as intended.
Ihr MERCONIS-Supportteam
Your MERCONIS Support Team
Benutzeravatar
supportteam2
 
Beiträge: 418
Registriert: 4. Mär 2015, 14:05

Re: Installing leadingsystems/lsjs

Beitragvon tenzin » 24. Aug 2020, 09:52

Thanks for the reply. I am just copying the lsjs folder manually.

But now I am noticing strange behavior. Whenever I load a product page for the first time and try to add the product to a cart, js error "«Uncaught TypeError: Cannot read property 'parentNode' of null»" is showing. If I reload the same page, the product can be added to a cart without any error (i.e Ajax update text is showing).

I've screen capture here in this video link: https://streamable.com/rzmx8p

Can you please suggest where to look for any settings. Thanks

=========SOLVED=========
Initially, since there were no products in a cart (mini-cart), cart Html is no present on the page. The script throws an error because it tries to update nonexisting Html. But when reloading, the mini cart is added (as we have added a product to the cart from the previous click action) to the template and hence script works.


Also the check for null at line lsjs.js::87 if ($(el_updated.getProperty('id')) === null) is always false. As $ is somehow jQuery in my installation. This would have worked, as in one of my other installation, if "$" is Mootool.
So to avoid this problem, put miniCart_1 Html on the page and hide it with css class, when there is no product.
tenzin
 
Beiträge: 33
Registriert: 9. Aug 2019, 09:47

Re: Installing leadingsystems/lsjs

Beitragvon supportteam2 » 26. Aug 2020, 07:12

Hi Tenzin,

because your issue seemed to be a little tricky and would take me quite some time to reproduce, I wasn't able to get to it on monday and yesterday. Now, I wanted to give it a shot and am very happy to see that you already solved the problem yourself. That's great news! And thank you very much for letting everybody know what you found out. This is very helpful in case someone else runs into the same thing.

There's one more thing though, that I want to say regarding the jQuery vs. Mootools problem. Usually, it's not a problem to use jQuery and Mootools alongside each other. Because Merconis requires Mootools, we have this situation quite often. A problem occurs only if jQuery components which are not using the standard technique to provide Mootools compatibility are active in the project. See this link for more information: https://api.jquery.com/jquery.noconflict/
Ihr MERCONIS-Supportteam
Your MERCONIS Support Team
Benutzeravatar
supportteam2
 
Beiträge: 418
Registriert: 4. Mär 2015, 14:05

Re: Installing leadingsystems/lsjs

Beitragvon tenzin » 26. Aug 2020, 09:38

Thank you.
I have found out the main culprit. It was the older version of mediaelement js (version 4.2.6), which caused this problem. Now I've removed the older mejs and used the one came with Contao (mejs version: 4.2.14). Now it works (even with lsjs v.2.0.10).
tenzin
 
Beiträge: 33
Registriert: 9. Aug 2019, 09:47


Zurück zu Installation

Wer ist online?

Mitglieder in diesem Forum: 0 Mitglieder und 1 Gast