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
Nop-Templates.com wrote:
Hi guys,

Noticed a few small issues in the administration in 4.0:

1. Visit "System -> System Information" page. The dates for the assemblies are very strange and very different i.e years could be 1969, 1909 etc.

Microsoft.AspNetCore, Version=2.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60 Release
C:\DEV\nopCommerce_4.0\Presentation\Nop.Web\bin\Debug\net461\Microsoft.AspNetCore.dll
1969-11-18T23:31:51


This is a bit confusing as most of us were not born in 1909 ;)

2. On the "Customer settings" page when you add a customer attribute and save it the link "back to customer attribute list" is not working and you can't go back. It points to this "/Admin/CustomerAttribute/List" which does not exist while I guess it should return to the customer settings page.

3. A few missing resources:

admin.configuration.settings.generalcommon.blocktitle.adminarea
admin.configuration.settings.generalcommon.adminarea.usericheditorinmessagetemplates

Thanks
Boyko


Hello, I fixed two of this issues, please see this commits:
1. System Information page. Fixed error on showing dates for the assemblies
3.Added missing locales
6 years ago
Hi Andrei,

a.m. wrote:
- if a Razor view could not be found when doing Ajax calls. You can see the error in the Response in the Network tab in the browser but no error is being logged in the Log
Could you please provide some details on how to reproduce the issue?


Simply rename the _EstimateShippingResult.cshtml (i.e _EstimateShippingResult1.cshtml) so that it could not be found. Then try to estimate the shipping and you will see the "Internal Server Error" page in the Network tab but no error is logged in the System -> Log.
Actually this is not just about Ajax calls. Any time you get an error that a view could not be found you won't get this error logged in the Log.

a.m. wrote:

- Missing AntyForgeryToken in Ajax requests. Again no error in the Log (and no details for the error in the response in the browser as you just get bad request 400 error)
ASP.NET AntiFogery implementation doesn't send any specific error details. So we can log only general 400 error (bad request). I've just implemented it


Actually I got the error below when the token is missing:

"Antiforgery token validation failed. The required antiforgery header value "RequestVerificationToken" is not present."

But I have enabled the default logging in the Web.config like this:

<aspNetCore requestTimeout="00:05:00" processPath="%LAUNCHER_PATH%" arguments="%LAUNCHER_ARGS%" forwardWindowsAuthToken="false" stdoutLogEnabled="true" stdoutLogFile=".\logs\stdout"/>


But since we don't have access to our clients file systems and we don't want to ask them to enable the logging every time I thought it would be good to log such errors in the database.

Anyway the idea is that if this error is logged in a file I think there must be a way to log it in the System -> Log as well.

p.s: You might consider adding the above changes in the Web.config but have the Log disabled by default. This will help us give simple instructions to our clients to just change it from false to true if needed.

Hope this information is useful!

Thanks,
Boyko
6 years ago
Nop-Templates.com wrote:
Simply rename the _EstimateShippingResult.cshtml (i.e _EstimateShippingResult1.cshtml) so that it could not be found. Then try to estimate the shipping and you will see the "Internal Server Error" page in the Network tab but no error is logged in the System -> Log...

Thanks! I'll check

Nop-Templates.com wrote:
But I have enabled the default logging in the Web.config like this...

Yes, this is how ASP.NET team implemented it (please see here)

So the  default ASP.NET logging (enabled in web.config as you suggested) is the only way to get the detailed error text. But it's not user-friendly. We've implemented a workaround that can be used to "guess" (with 99%) what happened
6 years ago
a.m. wrote:

Yes, this is how ASP.NET team implemented it (please see here)

So the  default ASP.NET logging (enabled in web.config as you suggested) is the only way to get the detailed error text. But it's not user-friendly. We've implemented a workaround that can be used to "guess" (with 99%) what happened


Hi Andrei,

Thank you for the clarification! I didn't look into the code to see how this was implemented!

I am sure you will find the best possible solution for this!

p.s: I am not sure how the default logger works exactly but if the store owners can enable a setting in the administration that will enable it and then we somehow make it log ONLY the errors in the System -> Log then this will be the perfect solution. As now when enabled from the Web.config it creates a lot of informational messages and keeps them in several log files and it is quite hard to find the errors.
Also note that the Logs folder needs to be created in advance in order for the default logger to log anything which is quite a limitation.

Many thanks again!
Boyko
6 years ago
Nop-Templates.com wrote:
Hi guys,

In this commit you have removed PluginFileParser and its logic (methods) is not moved into the PluginManager itself but into private methods so we can't really reuse this logic anymore and have to "copy" it.
For example we used this method to get all installed plugins and check if a plugin is installed or not:

PluginFileParser.ParseInstalledPluginsFile


Now we can't use it anymore unless you make GetInstalledPluginNamesmethod of the PluginManager to be public. The same aplies for the other methods although we don't use them but they could also be quite handy if you want to modify the installedPlugins.json.

We could easily copy the code as it is quite simple but it is preferable to reuse as much as possible of the existing code in nopCommerce and thus be consistent and make future upgrades easier.

p.s: It would also be useful if you make the constants like the location of the installedPlugins file to be accessible/public would make such upgrade changes easier for plugin vendors.

Thanks
Boyko

Hi Boyko,

Why don't you use "ReferencedPlugins" property for such purposes? You can get a list of plugins this way
6 years ago
Hi,

when I try to load NopCommerce.sln in VS2015 I get this error for all project:

The default XML namespace of the project must be the MSBuild XML namespace. If the project is authored in the MSBuild 2003 format, please add xmlns="http://schemas.microsoft.com/developer/msbuild/2003" to the element. If the project has been authored in the old 1.0 or 1.2 format, please convert it to MSBuild 2003 format.


Any idea?
thanks
6 years ago
You need VS 2017 (not 2015)
6 years ago
a.m. wrote:

Why don't you use "ReferencedPlugins" property for such purposes? You can get a list of plugins this way


Yes, I think this would work for us in this case although it will not return any plugins that are not compatible with the current version of nopCommerce but are present in the installedplugins.json.
Anyway it is just two lines of code if we need to load the installedplugins.json file now so don't worry about it and you can simply keep the old methods private.

Thanks,
Boyko
6 years ago
Hi Nop Team,

Thanks for your great. I have got the following error. is it known?  
Error:

~\nopCommerce\src\Presentation\Nop.Web\Areas\Admin\Views\Plugin\EditPopup.cshtml

'PluginModel' does not contain a definition for 'Id' and no extension method 'Id' accepting a first argument of type 'PluginModel' could be found (are you missing a using directive or an assembly reference?)
    @await Component.InvokeAsync("AdminWidget", new { widgetZone = "admin_plugin_details_buttons", additionalData = Model.Id })

Url: "/Admin/Plugin/List"

Click on Edit button for any  plugin.

Version 4.00 (development branch)

Fix: 'PluginModel's base class will be "BaseNopEntityModel" instead "BaseNopModel"
6 years ago
Thanks a lot for reporting, Sohel! Fixed
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.