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 u开发者_如何学Pythonse 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.
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
@Html.ActionLink(T("Delete menu").Text, "Delete", "MenuAdmin", new { Area = "Szmyd.Orchard.Modules.Menu" }, new { @class = "button primaryAction" })
with:
<a href="@Html.AntiForgeryTokenGetUrl(Url.Action("Delete", new { menuName = Model.MenuName }))" class="button primaryAction">@T("Delete menu") </a>
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.
精彩评论