logo
Welcome to our new AbleCommerce forums. As a guest, you may view the information here. To post to this forum, you must have a registered account with us, either as a new user evaluating AbleCommerce or an existing user of the application. For all questions related to the older version of Gold and earlier, please go to AbleCommerce Gold forum. Please use your AbleCommerce username and password to Login. New Registrations are disabled.

Notification

Icon
Error

Options
Go to last post Go to first unread
ray22901031  
#1 Posted : Wednesday, May 6, 2020 11:50:51 PM(UTC)
ray22901031

Rank: Advanced Member

Groups: Authorized User, Developers
Joined: 2/17/2019(UTC)
Posts: 909

Thanks: 3 times
Was thanked: 15 time(s) in 15 post(s)
There is a major bug in product finder, I am not sure if this has to do with the code modification I was told to do regarding the product template.

https://www.ablecommerce...ts/t260-Product-template

When a template has multiple selections, in this case the radio can have two choices "Analog" and "Digital", only the first choice is displayed in product finder.

Hopefully you can reproduce this, this is a major problem for us.

Many Thanks

Wanna join the discussion?! Login to your AbleCommerce Forums forum account. New Registrations are disabled.

ray22901031  
#2 Posted : Thursday, May 7, 2020 3:26:39 AM(UTC)
ray22901031

Rank: Advanced Member

Groups: Authorized User, Developers
Joined: 2/17/2019(UTC)
Posts: 909

Thanks: 3 times
Was thanked: 15 time(s) in 15 post(s)
To offer a better explanation, if the template has multiple values, only the first value is properly filtered by product finder. All other values are ignored.

Example: A template has the following multi-options:

A
B
C
D

Product number one, has the value on this field set to A, B and D

Product finder role only filter on "A". This is the same problem that was occurring in the admin section after a space was added to the ",".
Please note that I have noticed this after the code change.

I hope this better explanation helps,
-Ray

shari  
#3 Posted : Thursday, May 7, 2020 4:29:06 AM(UTC)
shaharyar

Rank: Advanced Member

Groups: Admin, Developers, Registered, HelpDesk, Authorized User
Joined: 10/5/2018(UTC)
Posts: 704

Thanks: 5 times
Was thanked: 113 time(s) in 112 post(s)
Hi,

I am unable to reproduce the issue or I think I need to know more details.

Are you referring to the Product Finder page (site.com/Search)?
Are you searching from the product finder sidebar widget on a Narrow by Keyword search field?


Quote:
When a template has multiple selections, in this case, the radio can have two choices "Analog" and "Digital", only the first choice is displayed in product finder.


In a radio type input, you can only select one value. We can never have multiple selections for a radio type input field.

Is it possible for you to take screenshots to explain it in detail?

Thanks
Shaharyar
ray22901031  
#4 Posted : Thursday, May 7, 2020 8:18:11 AM(UTC)
ray22901031

Rank: Advanced Member

Groups: Authorized User, Developers
Joined: 2/17/2019(UTC)
Posts: 909

Thanks: 3 times
Was thanked: 15 time(s) in 15 post(s)
Here are the steps necessary to reproduce the problem.

Version: 9.0.2.6218

#1. You will need to make the two code changes to the ProductController.cs as specified in the post, this is because when you create a product template that has multiple values, the spaces between the "," get trimmed out and it displays poorly. This should have been fixed, but it was overlooked.

#2. The second change to the ProductController.cs, corrects the problem that you do not see multiple values in the admin, after making the first change above.

#3. Once these changes are made, create a product template and assign it to a product were one of the fields consist of multiple values. Assigned t, 2 or more of the multiple values to the product, make sure that you have checked " If checked, the product search can be used to filter by this field."

#4.Click on the "product finder", which is, your domain name/Search, and you're only allowed to filter or search by the first value listed on the multi field option.

Right off the bat, you can tell there's something wrong because the counts are incorrect. If I were to undo the changes specified by support, everything would work properly. This is the identical problem that was occurring on #2, listed above, product finder is being confused because after the code changes and the new built, it is having difficulties finding multiple values because now they have the proper spaces between options.

I hope this clarifies things.

Many thanks

ray22901031  
#5 Posted : Thursday, May 7, 2020 8:28:57 AM(UTC)
ray22901031

Rank: Advanced Member

Groups: Authorized User, Developers
Joined: 2/17/2019(UTC)
Posts: 909

Thanks: 3 times
Was thanked: 15 time(s) in 15 post(s)
In reference to the above post, I have provided two pictures to better clarify the issue. The first picture shows the front end, and the second picture shows the back-end. If you look at the front end under radio market where it shows hospitality having a number count of 2, this is incorrect. There are multiple radios that have hospitality listed, in fact over 35 of them, but it's only showing 2, which are the only two where hospitality is the first value.

This is a major bug for us, please this needs to be rectify. The problem with the system trimming multiple values on a product template should have been fixed this version as promised, again because of the code changes, this new problem has arisen.

Thank you so much for your time,
-Ray
AB-Search-Error-Admin.jpg (545kb) downloaded 3 time(s). AB-Search-Error.jpg (812kb) downloaded 4 time(s).
shari  
#6 Posted : Thursday, May 7, 2020 8:41:22 AM(UTC)
shaharyar

Rank: Advanced Member

Groups: Admin, Developers, Registered, HelpDesk, Authorized User
Joined: 10/5/2018(UTC)
Posts: 704

Thanks: 5 times
Was thanked: 113 time(s) in 112 post(s)
Thank you for the screenshots. It's the shop by feature I was missing.

I'll look into this and will reply soon.
ray22901031  
#7 Posted : Thursday, May 7, 2020 8:52:27 AM(UTC)
ray22901031

Rank: Advanced Member

Groups: Authorized User, Developers
Joined: 2/17/2019(UTC)
Posts: 909

Thanks: 3 times
Was thanked: 15 time(s) in 15 post(s)
Here's another way to look at the problem.

The "before picture" shows what the front end of the website looks like, and what the table "acProductTemplateFields" shows on the backend. Please notice the number counts on the before picture when the table structure in the backend displays properly with spaces between the ",".

The "after picture" shows what happens when I remove all the spaces in just one row, in other words like executing a trim(), as you can see, it displays properly in the front end if I were to remove all the spaces. Just look at the increase number counts.

Again, we took care of the two problems, and now we just need to take care of the last one.

Many thanks and I hope this helps,
-Ray AB-Before.jpg (1,220kb) downloaded 5 time(s). AB-After.jpg (1,301kb) downloaded 5 time(s).

Edited by user Thursday, May 7, 2020 8:53:26 AM(UTC)  | Reason: Not specified

shari  
#8 Posted : Friday, May 8, 2020 5:12:28 AM(UTC)
shaharyar

Rank: Advanced Member

Groups: Admin, Developers, Registered, HelpDesk, Authorized User
Joined: 10/5/2018(UTC)
Posts: 704

Thanks: 5 times
Was thanked: 113 time(s) in 112 post(s)
Thank you for the screenshots. It helped me understand the original issue.

I have seen the backend code and it appears to me that while loading from the database our query expects the value to be comma-separated but without spaces and as in our previous fix we added spaces after the comma and saved the values to the database so the results are now invalid.

The first step to fix this issue is to roll back the previous related changes and the current issue will be resolved.
After that, another change will be needed to fix the original issue mentioned in a separate thread
i-e
Quote:
2. When using a multiple listbox, it would be nice to have a spacing after the ",". It's being displayed in the product detail, right now without any space between values.


To roll back the changes:

1- Please open file: ~\Website\Areas\Admin\Controllers\ProductController.cs

2- Search this line

Code:
return string.Join(", ", values.ToArray());



3- Replace it with

Code:
return string.Join(",", values.ToArray());


4- Search the line

Code:
List<string> SelectedValue = selectedValue.Replace(", ", ",").Split(',').ToList<string>();



5- Replace it with

Code:
List<string> SelectedValue = selectedValue.Split(',').ToList<string>();


To fix the original issue:

1- Please open file: ~\Website\Controllers\ProductController.cs

2- Search this line

Code:
InputValue = tf.InputValue



3- Replace it with

Code:
InputValue = tf.InputValue.Replace(",", ", ")



Please note that a code compile will be needed for controller file change.
ray22901031  
#9 Posted : Friday, May 8, 2020 10:51:51 AM(UTC)
ray22901031

Rank: Advanced Member

Groups: Authorized User, Developers
Joined: 2/17/2019(UTC)
Posts: 909

Thanks: 3 times
Was thanked: 15 time(s) in 15 post(s)
Server Error in '/' Application.
Runtime Error
Description: An exception occurred while processing your request. Additionally, another exception occurred while executing the custom error page for the first exception. The request has been terminated.

===

I did exactly what I was told to do, I followed your directions to the letter. Please note I am not what I consider to be an experienced developer on the backend. I opened Visual Studio 2019 and made the changes to the ~\Website\Areas\Admin\Controllers\ProductController.cs as instructed.

I then opened ~\Website\Controllers\ProductController.cs and made the changes as instructed.

After a successful built, I copied the ablecommerce.dll to the web site, restarted IIS and the system exploded.

Besides copying the ablecommerce.dll, are there any other files that I need to copy over after a successful built?

Either way, in order to get the system working again, I had to restore from a backup. The entire site had to be restore.

Please advise,
-Ray

Edited by user Friday, May 8, 2020 11:28:24 AM(UTC)  | Reason: Not specified

shari  
#10 Posted : Friday, May 8, 2020 11:35:10 AM(UTC)
shaharyar

Rank: Advanced Member

Groups: Admin, Developers, Registered, HelpDesk, Authorized User
Joined: 10/5/2018(UTC)
Posts: 704

Thanks: 5 times
Was thanked: 113 time(s) in 112 post(s)
Are you able to see the admin pages or the entire site is broken?

If you can login to admin please share any error entries from error log page.
ray22901031  
#11 Posted : Friday, May 8, 2020 11:44:06 AM(UTC)
ray22901031

Rank: Advanced Member

Groups: Authorized User, Developers
Joined: 2/17/2019(UTC)
Posts: 909

Thanks: 3 times
Was thanked: 15 time(s) in 15 post(s)
The site was restored from a previous version so there are no error logs.

could this have anything to do with the fact that the values in the database have spaces?

Edited by user Friday, May 8, 2020 11:45:03 AM(UTC)  | Reason: Not specified

ray22901031  
#12 Posted : Friday, May 8, 2020 12:13:14 PM(UTC)
ray22901031

Rank: Advanced Member

Groups: Authorized User, Developers
Joined: 2/17/2019(UTC)
Posts: 909

Thanks: 3 times
Was thanked: 15 time(s) in 15 post(s)
I have restored to a previous version and again follow the steps, in the ~\Website\Areas\Admin\Controllers\ProductController.cs there are two places, I only changed one where this value existed "return string.Join(", ", values.ToArray());"

I've also made the change in the ~\Website\Controllers\ProductController.cs

The site is running however, the problem is NOT FIXED, product finder does not filter on anything except the first value.

Thanks
Please advise,
-Ray
shari  
#13 Posted : Friday, May 8, 2020 12:27:00 PM(UTC)
shaharyar

Rank: Advanced Member

Groups: Admin, Developers, Registered, HelpDesk, Authorized User
Joined: 10/5/2018(UTC)
Posts: 704

Thanks: 5 times
Was thanked: 113 time(s) in 112 post(s)
Please remove the spaces from database or try saving the admin page.
I-e Edit product template page.
ray22901031  
#14 Posted : Friday, May 8, 2020 12:33:03 PM(UTC)
ray22901031

Rank: Advanced Member

Groups: Authorized User, Developers
Joined: 2/17/2019(UTC)
Posts: 909

Thanks: 3 times
Was thanked: 15 time(s) in 15 post(s)
Thank you for your reply, you have read my mind as I figured that an additional step would be necessary in the database. I have not even had my 1st cup of coffee yet, so I'm going to let this go until later today and I will issue a trim command on that particular field in the database table.

I will get back to you with my results.

This fix will be included in the next version correct?

Thank you Shari
ray22901031  
#15 Posted : Friday, May 8, 2020 12:36:51 PM(UTC)
ray22901031

Rank: Advanced Member

Groups: Authorized User, Developers
Joined: 2/17/2019(UTC)
Posts: 909

Thanks: 3 times
Was thanked: 15 time(s) in 15 post(s)
On second thought, a trim command will not work since some of my values have spaces in-between, so search and replace will do.
shari  
#16 Posted : Friday, May 8, 2020 12:58:31 PM(UTC)
shaharyar

Rank: Advanced Member

Groups: Admin, Developers, Registered, HelpDesk, Authorized User
Joined: 10/5/2018(UTC)
Posts: 704

Thanks: 5 times
Was thanked: 113 time(s) in 112 post(s)
Yes most probably this fix will be included in the next release.

If you go to the edit product page and templates tab. Save the page and it will correct the values in database.

Please try to follow complete instructions/steps given in the post.

ray22901031  
#17 Posted : Friday, May 8, 2020 1:30:25 PM(UTC)
ray22901031

Rank: Advanced Member

Groups: Authorized User, Developers
Joined: 2/17/2019(UTC)
Posts: 909

Thanks: 3 times
Was thanked: 15 time(s) in 15 post(s)
>>> If you go to the edit product page and templates tab. Save the page and it will correct the values in database.

Unfortunately this is very time-consuming unless you have very few products, is just better to go in the backend and take care of it there.

>>> Please try to follow complete instructions/steps given in the post.

I did, but the instructions were not complete, nowhere in the instructions was I told to fix the values in the database, that is something I had to conclude by myself. Also there were two places under "return string.Join(", ", values.ToArray());" that needed to be fixed, instructions did not specify that.

Regarding the "Server Error in '/' Application." problem, for those who are interested. After I did the built and I copied over the "Ablecommerce.dll" to the bin directory , I renamed the original one Ablecommerce-050820.dll, I always like to keep a copy of the old version just in case.

Unfortunately Ablecommerce does not like this, not sure because it had a similar name and it confused the system, either way that is what was creating the problem. In the future since I like to save original files, I will just move them to a different directory.

I hope this helps

Edited by user Friday, May 8, 2020 1:31:02 PM(UTC)  | Reason: Not specified

Users browsing this topic
Guest (9)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.