Orchard CMS - 导航不再起作用
我是 Orchard CMS 系统的新手。 http://www.orchardproject.net
我安装了版本 1.0,现在他们更新了,我安装了版本 1.1.30,但是从未真正发表过东西。
我下载了导航功能“高级菜单 - 版本:1.2.1”,我看到了一些可以使用的菜单项并尝试了一些东西。但我无法再删除它们。
如果我禁用并启用我会收到错误:
In einen eindeutigen Index kann kein doppelter Wert eingefügt werden.
[ Table name = Szmyd_Orchard_Modules_Menu_AdvancedMenuPartRecord,Constraint
name = UQ__Szmyd_Orchard_Modules_Menu_AdvancedMenuPartRecord__0000000000000352 ]
但我可以看到带有高级子项目的导航菜单。
我不知道菜单从哪里获取他的信息,但像“Sprecher”这样的一些项目位于“高级菜单导航”上,但是当我单击删除时,会出现错误:
404 - Datei oder Verzeichnis wurde nicht gefunden.
我已经尝试了几天的任何解决方案,但没有成功。请帮忙。
I am new to Orchard CMS system. http://www.orchardproject.net
I installed Version 1.0 and now they updated and I installed version 1.1.30 but never really published something.
I downloaded Navigation Feature "Advanced menu - Version: 1.2.1" and I saw some menu items to use and tried something. But I could not delete them anymore.
If I disable and enable I receive error:
In einen eindeutigen Index kann kein doppelter Wert eingefügt werden.
[ Table name = Szmyd_Orchard_Modules_Menu_AdvancedMenuPartRecord,Constraint
name = UQ__Szmyd_Orchard_Modules_Menu_AdvancedMenuPartRecord__0000000000000352 ]
But I can see Navigation menu with advanced subitems.
I don't know where the menu gots his information from but some items like "Sprecher" is on the "Advanced menu Navigation" but when I click delete the error occours:
404 - Datei oder Verzeichnis wurde nicht gefunden.
I have tried several days for any solution without success. Please help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我设法找出问题的根源,并且都将在即将发布的版本中修复。我会尝试在本周末之前完成。
第一期
不要担心禁用和启用模块后遇到的错误 - 它是一次性的并且不会影响模块使用(但当然会被修复)。
禁用模块不会删除任何底层数据库表 - 它只是告诉框架不要使用模块代码。默认菜单是在启用步骤中创建的,即使您禁用该模块也会保留在那里。不幸的是,它不会检查菜单是否已经创建,因此每次您启用该模块时,它都会大喊“尝试在唯一索引中插入重复项”(菜单名称是唯一的)。
第二个问题< /strong>
您可以应用此修复程序以允许删除菜单。
转到 [Root]/Modules/Szmyd.Orchard.Modules.Menu/Views/MenuAdmin/Index.cshtml 并替换
为:
这将使删除链接正确呈现。
更新
我忘记补充一点,有些人报告删除操作不适用于名为'main'的菜单。我调查了这个问题并找到了问题的根源。
首先
主菜单的问题在于,管理仪表板中的“主菜单”链接始终存在,无论您是否删除菜单。此链接是由旧的默认 Orchard 导航系统添加的,但其指向的 URL 被高级菜单模块覆盖。
第二
删除菜单后,相应的菜单项并没有被删除。项目通过名称与相应的菜单连接,因此,如果删除“主”菜单,则在菜单本身被删除后,连接到“主”的所有项目仍然存在。这就是为什么单击“主菜单”后您会突然看到所有菜单项,就像什么也没发生一样。 但是点击“删除菜单”会抛出一个很好的 404 错误,因为菜单本身不存在。
我会尽快解决所有这些问题并发布修复程序。
I managed to find out the sources of the problems and both will be fixed in the upcoming release. I'll try to do it by the end of this week.
First issue
Don't worry with the error you encountered after disabling and enabling the module - it's one time and doesn't affect module usage (but will be fixed, of course).
Disabling a module doesn't delete any underlying database tables - it's just telling the framework not to use the module code. The default menu gets created at the Enabling step, and sits there even if you disable the module. Unfortunately, it's not checking whether the menu has already been created, so every time you enable the module it shouts about "trying to insert a duplicate in unique index" (menu name is unique).
Second issue
You can apply this fix to allow deleting menus.
Go to [Root]/Modules/Szmyd.Orchard.Modules.Menu/Views/MenuAdmin/Index.cshtml and replace
with:
This will make delete links render correctly.
UPDATE
I forgot to add that some people reported that Delete operation won't work with menu called 'main'. I investigated the issue and found the source(s) of a problem.
First
The problem with the main menu is that, the "Main menu" link in admin Dashboard is always there, whether you delete the menu or not. This link is being added by the old, default Orchard navigation system, but url to where it leads is overwritten by Advanced Menu module.
Second
After deleting the menu, corresponding menu items are not deleted. Items are connected with the corresponding menu by it's name, so if you delete 'main' menu, all items connected to 'main' are still there, after the menu itself got deleted. That's why after clicking the "Main menu" you suddenly see all menu items as if nothing happened. But clicking "Delete menu" will throw you a nice 404 error, because menu itself not exists.
I'll address all of these issues asap and publish a fix.