statisticssweden / PxWeb

Web application for disseminating statistical tables
https://www.scb.se/pxweb
Apache License 2.0
35 stars 23 forks source link

Error when switiching language in "Show result" PxWeb 2023 v1 #619

Open AstridMonica opened 8 months ago

AstridMonica commented 8 months ago

Describe the bug In our PxWeb site we have two languages, Swedish and English.. In the new version PxWeb 2023 v1 I get an error if I switch language when in "Show result".

Steps to reproduce the behavior:

  1. Choose table
  2. Choose variables
  3. Click on Show table
  4. Click on "Swedish"
  5. See error

Expected behavior In version PxWeb 2022 v1 it goes back to "Choose variable".

Actual behavior Seems to look for APIV2URL although we are not using that. From the log file: ERROR Global - System.Web.HttpUnhandledException (0x80004005): Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.NullReferenceException: Object reference not set to an instance of an object. at PCAxis.Web.Controls.TableQueryCodebehind.ShowApiV2URL() at PCAxis.Web.Controls.TableQueryCodebehind.Page_LanguageChanged(Object sender, EventArgs e) at PCAxis.Web.Core.ControlBase2.OnLanguageChanged(EventArgs args) at PCAxis.Web.Core.ControlBase2.set_CurrentCulture(CultureInfo value) at PCAxis.Web.Core.Management.LocalizationManager.ChangeLanguage(CultureInfo culture) at PCAxis.Web.Core.Management.LocalizationManager.ChangeLanguage(String language) at PXWeb.PxWeb.Page_Init(Object sender, EventArgs e) at System.Web.UI.Control.OnInit(EventArgs e) at System.Web.UI.Control.InitRecursive(Control namingContainer) at System.Web.UI.Control.InitRecursive(Control namingContainer) at System.Web.UI.Control.InitRecursive(Control namingContainer) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.HandleError(Exception e) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest() at System.Web.UI.Page.ProcessRequest(HttpContext context) at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

likp commented 8 months ago

@JohannesFinsveen I think that your fix that you showed yesterday will also fix this problem. Can you do a PR for it?

JohannesFinsveen commented 8 months ago

After lunch :-)

JohannesFinsveen commented 8 months ago

That problem is: when you return to a site after some time with a url that ends with /tableViewLayout1/ you should be rediected to the url without /tableViewLayout1/ (there may a /table/ there as well)

JohannesFinsveen commented 8 months ago

Sorry, closed by mistake. Could you see if this is ok now?

andrus-aru commented 4 days ago

We have the same problem with the compiled 2023 v1 code downloaded from Statistics Sweden’s download portal. For us the issue only happens when using SQL database, the PX-file based is not affected. How can we implement this patch #620 to the compiled 2023 v1 version?