Skip to content

[Bug]: Data is Null in ModuleController.UpdateModuleSettingInternal #6475

@DanielBolef

Description

@DanielBolef

Is there an existing issue for this?

  • I have searched the existing issues

What happened?

When trying to update a module setting with ModuleController, if the existing setting value is equal to "FileID=<Some ID that doesn't exist in the Files table>", ModuleController.UpdateModuleSettingInternal throws an exception due to a NULL value when fetching the setting value before setting it.

Steps to reproduce?

  1. Create a ModuleSetting with value "FileID=<Some ID that doesn't exist in the Files table>".
  2. Try to update that setting using the ModuleController.

Current Behavior

Exception thrown.

Expected Behavior

Set the Module Setting.

Relevant log output

Message:Data is Null. This method or property cannot be called on Null values.
StackTrace:
   at System.Data.SqlClient.SqlBuffer.get_String()
   at DotNetNuke.Entities.Modules.ModuleController.UpdateModuleSettingInternal(Int32 moduleId, String settingName, String settingValue, Boolean updateVersion)
InnerMessage:
InnerStackTrace:
Source:System.Data

Anything else?

Appears to be due to a bug in the FilePath SQL Function.

Affected Versions

9.13.8 (latest release)

What browsers are you seeing the problem on?

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions