Developer forum

Forum » Swift » Bug in Swift 1.21.0 - Button item template

Bug in Swift 1.21.0 - Button item template

Marie Louise Veigert
Reply

Hi,

I have found a small bug in this Swift template (\Files\Templates\Designs\Swift\Paragraph\Swift_Button.cshtml)

I fixed it on our solution, but maybe someone else will run into it.
Issue is if you have used the button to link to a product - but you are on a user without it in assortment.

Code failing on line 160: 

string productLink = products.Products.FirstOrDefault().GetProductLink(GetPageIdByNavigationTag("Shop"), false);

I just made a nullcheck on it.

 

BR Marie Louise


Replies

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply
This post has been marked as an answer

Good find, bug devops#14299!

Thanks, Nicolai

Votes for this answer: 1
 
Marie Louise Veigert
Reply

And you can add this to the list as well :)

\Files\Templates\Designs\Swift\Paragraph\Swift_Text.cshtml
 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply
This post has been marked as an answer

Actually all these:

Votes for this answer: 1
 
Marie Louise Veigert
Reply

Thanks Nicolai!
We are using a lot of them in this solution :)

 

You must be logged in to post in the forum