Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeUsing DNN Platf...Using DNN Platf...Language and In...Language and In...DotNetNuke.Services.Exceptions.ModuleLoadException: Sequence contains more than one element DotNetNuke.Services.Exceptions.ModuleLoadException: Sequence contains more than one element
Previous
 
Next
New Post
3/2/2011 8:07 AM
 
Hi,

I get this exception when editing a language or when trying to generate localized version of pages or publish them (the process fails).

This seems to be related: http://www.dotnetnuke.com/tabid/795/forumid/77/postid/405843/scope/posts/default.aspx

This is a trace, including line numbers (this is a DNN 5.6.1):

DotNetNuke.Services.Exceptions.ModuleLoadException: Sequence contains more than one element ---> System.InvalidOperationException: Sequence contains more than one element at System.Linq.Enumerable.SingleOrDefault[TSource](IEnumerable`1 source) at DotNetNuke.Entities.Modules.ModuleController.AddModulePermission(ModuleInfo& objModule, Int32 portalId, String roleName, PermissionInfo permission, String permissionKey) in C:\Builds\Maintenance\WorkingDirectory\Library\Entities\Modules\ModuleController.vb:line 108 at DotNetNuke.Entities.Modules.ModuleController.LocalizeModuleInternal(ModuleInfo sourceModule) in C:\Builds\Maintenance\WorkingDirectory\Library\Entities\Modules\ModuleController.vb:line 161 at DotNetNuke.Entities.Modules.ModuleController.LocalizeModule(ModuleInfo sourceModule, Locale locale) in C:\Builds\Maintenance\WorkingDirectory\Library\Entities\Modules\ModuleController.vb:line 1331 at DotNetNuke.Entities.Tabs.TabController.CreateLocalizedCopy(TabInfo originalTab, Locale locale) in C:\Builds\Maintenance\WorkingDirectory\Library\Entities\Tabs\TabController.vb:line 1154 at DotNetNuke.Modules.Admin.Languages.EditLanguage.cmdUpdate_Click(Object sender, EventArgs e) --- End of inner exception stack trace ---

ModuleController.vb:line 108 is this the red line here:

Private Sub AddModulePermission(ByRef objModule As ModuleInfo, ByVal portalId As Integer, ByVal roleName As String, ByVal permission As PermissionInfo, ByVal permissionKey As String)

            Dim role As RoleInfo

            Dim modulePermission As ModulePermissionInfo

            Dim perm As ModulePermissionInfo



            perm = objModule.ModulePermissions.Where(Function(tp) tp.RoleName = roleName AndAlso tp.PermissionKey = permissionKey).SingleOrDefault()

            If permission IsNot Nothing AndAlso perm Is Nothing Then

                perm = objModule.ModulePermissions.Where(Function(tp) tp.RoleName = roleName AndAlso tp.PermissionKey = permissionKey).SingleOrDefault()

                modulePermission = New ModulePermissionInfo(permission
                ...
                ...


I thought this was related with something 'weird' about some module's permissions, and AddModulePermission() fails when is trying to copy them.
The exception happens because a singe result is expected, but instead of that, more than one 'row' is returned?
To test what happens (I can restart researching from a new clone of the site) I've deleted ALL rows from ModulePermission table. This error remains exactly the same.

So, this is not related with module's permissions, or is it? Is this then related with roles?
BTW, many people may say that LINQ is cool and how nice and readable it is. Maybe it's because I'm old, but I don't see this much readable. I prefer plain true SQL..

Does anybody know what this read line is really doing and why does it fail?
Any ideas will be much appreciated.

Thanks!
H





 
New Post
3/2/2011 8:18 AM
 
Maybe have a look at http://support.dotnetnuke.com/issue/V...
It looks very similar.

Craig
 
New Post
3/2/2011 1:15 PM
 
Craig, I don't see both issues being connected, the one here might be caused by duplicated records, returning more than one result as expected, but it requires to be debugged during execution.

Cheers from Germany,
Sebastian Leupold

dnnWerk - The DotNetNuke Experts   German Spoken DotNetNuke User Group

Speed up your DNN Websites with TurboDNN
 
New Post
3/2/2011 1:30 PM
 
Sebastian Leupold wrote:
might be caused by duplicated records, returning more than one result as expected

 
Hi,

Any clue about duplicate records on which table? I've completely deleted the ModulePermission table, and the problem is the same. So, it's not in this table. In which one this could be? In plain English (or better, in plain SQL) what does this LINQ expression is exactly trying to do?

Many thanks,
Horacio.-

 
New Post
3/2/2011 5:00 PM
 
there seem to be multiple modulepermissions with same rolename and permission key. Did you refresh the cache, after you deleted all permissions?

Cheers from Germany,
Sebastian Leupold

dnnWerk - The DotNetNuke Experts   German Spoken DotNetNuke User Group

Speed up your DNN Websites with TurboDNN
 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Language and In...Language and In...DotNetNuke.Services.Exceptions.ModuleLoadException: Sequence contains more than one element DotNetNuke.Services.Exceptions.ModuleLoadException: Sequence contains more than one element


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out