nopCommerce 4.0 - Bug fixes and improvements

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
6 years ago
Hi Andrei,

In addition to Stoyan's information above.

I think this looks like an encoding issue. The min/max values contain the '+' symbol which seems to be encoded in the new version of nopCommerce.
By looking at the HTML returned by the server in 3.9 the min value is this one '-1.79769313486232E+308' while in 4.0 it is like '-1.79769313486232E+308'.

Hope this helps!

Boyko
6 years ago
Hi Boyko,

It still works fine on my side (with "double")

1. So it works fine for "decimal" but doesn't dor "double"? Please confirm. It's the weirdest thing
2. Do you experience it on the clean installation of nopCommerce? Just replace some "decimal" property with "double" to test it out?
3. Let's try the following. Please open \Admin\Views\Shared\EditorTemplates\Double.cshtml and replace min: @double.MinValue with @Html.Raw(double.MinValue). Do the same for @double.MaxValue. Does it help you?
6 years ago
a.m. wrote:
Hi Boyko,

It still works fine on my side (with "double")

1. So it works fine for "decimal" but doesn't dor "double"? Please confirm. It's the weirdest thing
2. Do you experience it on the clean installation of nopCommerce? Just replace some "decimal" property with "double" to test it out?
3. Let's try the following. Please open \Admin\Views\Shared\EditorTemplates\Double.cshtml and replace min: @double.MinValue with @Html.Raw(double.MinValue). Do the same for @double.MaxValue. Does it help you?


Hi Andrei,

1. Yes

2. Yes, it is a clean install with one of our plugins that uses some double settings.

3. Yes, @Html.Raw(double.MinValue) fixes it.

It is really strange why it works on your side but on my machine and on Stoyan's machine it is not working without the fix above (I checked that the culture is set to en-Us).

Thanks,
Boyko
6 years ago
[quote=Nop-Templates.com]3. Yes, @Html.Raw(double.MinValue) fixes it/quote]
Looks like this change was introduced in ASP.NET Core. I've made a small test to check it:
1. To make it clear (e.g. do not think how shared editors work, etc) you can open any cshtml file (e.g. /Home/Index.cshtml)
2. Add the following code to it:
<p>@double.MinValue</p>
3. Check HTML source when rendered
4. 3.90 will render -1.79769313486232E+308 and 4.00 will render -1.79769313486232E&#x2B;308
Not sure why they introduced this change.

I've just fixed it. Thanks again!
6 years ago
a.m. wrote:

I've just fixed it. Thanks again!


Hi Andrei,

I just tested it and I can confirm it is working now.

Many thanks again!

Boyko
6 years ago
Hi guys,

We get many of records of this error in the Log:

The remote server returned an error: (404) Not Found.

System.Net.WebException: The remote server returned an error: (404) Not Found.
   at System.Net.WebClient.UploadValues(Uri address, String method, NameValueCollection data)
   at System.Net.WebClient.UploadValues(String address, NameValueCollection data)
   at Nop.Services.Tasks.TaskThread.Run()


Does anyone else has such an error in the Log?

Thanks,
Boyko
6 years ago
Nop-Templates.com wrote:

We get many of records of this error in the Log:

The remote server returned an error: (404) Not Found.

System.Net.WebException: The remote server returned an error: (404) Not Found.
   at System.Net.WebClient.UploadValues(Uri address, String method, NameValueCollection data)
   at System.Net.WebClient.UploadValues(String address, NameValueCollection data)
   at Nop.Services.Tasks.TaskThread.Run()


Does anyone else has such an error in the Log?



I finally figured out why I got these errors in the Log.

I used the database from demos.nop-templates.com on my local machine running on http://localhost:15536/.
The new scheduled task implementation is trying to make a request to demos.nop-templates/scheduletask/runtask but since it is still running on 3.90 it return not found error.

I believe the current implementation could cause some misunderstandings in the future.
A lot of store owners have testing and live environments for their websites and usually use the a copy of production database on the testing server.
They will never be able to run their scheduled tasks on the testing server (and eventually test them) as the TaskThread.Run() will make requests only to the production (live) website.

Also if the store owner does not enter the store url correctly (if they enter it at all) they will not have their scheduled tasks ever run. Actually the scheduled task will be run on a different machine and they will never know.

I am sure we will have a lot of support request from clients complaining their scheduled tasks are not running or having a lot of errors like these in the Log.

I know it is best to use the store url if for example several nopCommerce instances are running etc. but at least there should be more meaningful message in the log when the store url is different than the current store url i.e just like you have a warning about this in the Warnings page.
So instead of making a request to the store it will log a message like this "Scheduled task not run. Please make sure the Specified store URL matches this store URL".

Thanks,
Boyko
6 years ago
You're absolutely right about the warnings page. It's created to find such configuration issues. So each store owner should be sure that he doesn't have any warnings.

Furthermore, it's not possible to get the current store URL in schedule tasks (\Nop.Services\Tasks\TaskThread.cs) because HTTP context is not available at that moment. So the only way to get URL is to use "storeContext.CurrentStore.Url"
6 years ago
a.m. wrote:
You're absolutely right about the warnings page. It's created to find such configuration issues. So each store owner should be sure that he doesn't have any warnings.

Furthermore, it's not possible to get the current store URL in schedule tasks (\Nop.Services\Tasks\TaskThread.cs) because HTTP context is not available at that moment. So the only way to get URL is to use "storeContext.CurrentStore.Url"


Hi Andrei,

I agree that store owners need to make sure they don't have any Warnings but the reality is that in most cases they don't even know that the Warnings page exists :)
There should be some notifications in the admin bar that there are Warnings so that the store owners can pay attention to these warnings.

In addition to this they should also be able to disable some warnings if they don't make sense to their store or mark some warnings as resolved i.e we don't have shipping methods since we sell digital goods etc.

Thanks,
Boyko
6 years ago
Nop-Templates.com wrote:
There should be some notifications in the admin bar that there are Warnings so that the store owners can pay attention to these warnings.

Good idea. Done. Thanks a lot for suggestion

Nop-Templates.com wrote:
In addition to this they should also be able to disable some warnings if they don't make sense to their store or mark some warnings as resolved i.e we don't have shipping methods since we sell digital goods etc.

Also done. Although not configurable. But you're right about this particular warning with shipping plugins
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.