I have content that has "Provide a menu link" enabled or otherwise have a reference to a node in the menu.
If I create a new draft or edit an existing draft, that menu link will be deleted when it should be left alone.

The problem does not happen if I set the workflow to immediately publish instead of using a draft.

Comments

robeano’s picture

Priority: Major » Minor

I was not able to replicate this. Are you using Pathauto or are you creating a path that is not the typical node/[nid] pattern?

becw committed a fix for handling manually entered URLs in #1087044: Custom URL path settings do not survive moderation. You may need want to try this again with the latest dev version workbench_moderation.

becw’s picture

Status: Active » Closed (cannot reproduce)

thekevinday: I can't duplicate this with Workbench Moderation 7.x-1.0-beta8, so I'm closing this issue. If you still have this problem after updating to beta8, please re-open this issue and describe steps I can use to duplicate the problem. Thanks!

thekevinday’s picture

Status: Closed (cannot reproduce) » Postponed (maintainer needs more info)

Unfortunately I am using 7.x-1.0-beta8 and the problem happens.
When I get some extra time, I will re-review this problem and try to get you more (reproducable) information.

thekevinday’s picture

Title: Menu link disappears when saving a draft » Menu link disappears when saving a draft, when using content-type-specific menus
Status: Postponed (maintainer needs more info) » Active

Okay heres some more details on the problem.

The default setup does not have any problems.
If I add a menu item to the menu interface for a given page and create a new draft for that page, then nothing breaks.

If I instead:
1) edit the content type (lets say "Page"),
2) navigate to the menu settings section and ensure that at least one checkbox is selected (lets say "User menu")
3) add a menu entry for some content/node (Lets say some node called "front")
4) create a new draft for the 'front' node.

After performing step #4 the menu item added in #3 will vanish.

This problem is probably related to how the menu-specific settings for a given node are added to each page-edit form when any content-type-specific menus are enabled for a given content type.

stevector’s picture

Kevin, what do you mean by "content-type-specific" menus? "User menu" is available to any content type.

Anyone, do menu entries respect revisions? I couldn't reproduce the exact behavior described here. I found that if I edited a published node (created a new draft/revision) and edited the menu title, the new menu title would immediately become active.

becw’s picture

@thekevinday are you using pathauto? If the path alias of the content is changing when the content is updated, you might need Pathauto persistent state.

thekevinday’s picture

@stevector
When the individual menus are enabled on a given content type, only those enabled menus are available to select from during the node edit process. These menu entries are managed by the node itself. Everytome the node is saved, the menu-entry gets updated based on the field settings. What I suspect is that somehow that data is not making itself to the node save part properly and NULL gets set. This causes the menu entry to be auto-deleted. (Thats my speculation anyway).

The "Provide a menu link" checkbox is always unchecked after I edit and save, despite it being checked during the save.

@becw
I am using rules module for path management.
Path aliases are being changed on a per-rule state (because my paths are dependend on a lot of dynamic variables in which pathauto provides insufficient granularity to do so). I do have the pathauto module enabled but no paths (other than taxonomies) are being handled.


Just to be on the safe side, I created a new content type that is not being processed by the rules module (and turned on rules module debugging to be sure of this).

The problem seems to stem from content created before the workbench & workbench_moderation modules were installed and configured.
New content created after the workbench modules are installed seem to function properly.

becw’s picture

Priority: Minor » Major

Maybe this is related to what happens when the first moderation record is created--it's likely that the published revision doesn't stay published, since if the content was published before Workbench Moderation was installed then there's no moderation record that says it is published.

This could be pretty important to resolve, since it will affect folks who enable Workbench Moderation on sites with existing content.

stevector’s picture

Title: Menu link disappears when saving a draft, when using content-type-specific menus » Menu link disappears when saving a draft of a node that was created before workbench moderation was installed.

I am still not able to reproduce this.

-I created a fresh install with no contrib modules. I made two published nodes with entries in the main menu.
-I then enabled workbench moderation as a module and for the content type I used.
-I created new drafts/edited/moderated and published the drafts.

The menu link remained throughout.

Kvart’s picture

I have the same problem, and I believe I found a way to reproduce it. Menu link remains if a node is published using "normal" form for node editing, no matter if it's created before or after enabling the Workbench moderation module. If I click on "New draft" or "Edit draft" tab and change from Publishing options the Moderation state to Published -> everything goes ok.

But if I publish the node using Workbench information block or through the Moderate tab (using revert function) -> menu link disappears.

becw’s picture

Hmm, I wonder if menu information is only present on nodes when they're loaded into the node edit form...

hedley’s picture

I am experiencing the same issue as described by Kvart in #10. Doesn't seem to matter when the module was enabled. It would seem the moderation block or tab isn't loading or saving the menu information properly.

Frederic wbase’s picture

i also have the same problem as number 10

grts

fre

NickWebman’s picture

For me, the menu info is dropped when the state goes from published to draft, as well as from need review to published.

Also, if you create a node and provide a menu link, then set its revision state to "needs review", the menu item appears in the menu (even though the node hasn't been approved yet).

thamas’s picture

Marked #1285164: menu items disappear when published as a duplicate of this issue.

tyuen’s picture

I seem to have the same issue as #10:

  • Content can be pre- or post- Workbench installation
  • Only seems to happen when going from "Needs Review" to "Published" when using the Moderate function in the Workbench Information block. Changing states within the Moderation tab or Edit Draft tab seems to keep the menu item, as does going directly from "Draft" to "Published".
thamas’s picture

Title: Menu link disappears when saving a draft of a node that was created before workbench moderation was installed. » Menu link disappears when publishing a node by the moderation dropdown or by the moderation view link

We had a quick look again and it seems that one of the patches below may cause the problem. Without them the module works fine.

http://drupal.org/node/1079134#comment-4859602
http://drupal.org/node/1083720#comment-4881548

thekevinday’s picture

Strange.
I had this problem long before I even knew about trigger patch and I do not use the diff patch.

It looks like there are quite a lot of different causes to this problem.

robeano’s picture

I have not been able to reproduce this particular behavior. For comment #17, neither of those patches have been committed, so I don't think they are the problem. I tried changing the URL path

Now I have a pretty basic installation here. Can someone list some of the other modules they have enabled where the menu item is lost when the node state is changed to Published?

thekevinday’s picture

Ugh, I am trying to reduce my list to things that would likely appear on or affect a node form, but that list is large in itself.

  • rules
  • ctools
  • date
  • field_permissions
  • field_group
  • link
  • linkit
  • entity
  • imce
  • imce_wysiwyg
  • wysiwyg
  • ckeditor
  • jammer
  • intlinks
Désiré’s picture

I think this is a token bug (in most cases): #1317926: menu_tokens function should not change the node object
and it is solved (yet just with a patch)

Désiré’s picture

Component: User interface » Miscellaneous
Status: Active » Needs review
thekevinday’s picture

Status: Needs review » Reviewed & tested by the community

the last module I expected to be the cause of this is the token module.

I can reproduce the problem in the referenced bug report and the solution does work.
I will mark this as reviewed & tested by the community, but I hope the other particular cases here can confirm that it solves the problem for them as well.

froeser’s picture

Hi,
I updated the token module to beta6.
But still:
Status: at an already existing content I did "edit draft" as an editor. -> saved as draft. Menu information still available, but is not visible for anonymous.
Then the editor saved the draft as "need review".

Publisher: read the review and just changed to "published" in the head of the node.
-> the Menu-information vanished, the node has no menu anymore.
It only happens if I use the dropdown menu in the tab "view draft" to publish it. If I set it to publish via the moderator tab or in the "edit draft" window it works fine.

(also all nodes which were a submenu of the edited node are now thrown out of there structure and just inserted in the top level). The publisher has to rearrange all menu's.

I think it's not solved with installing the newest release of the token module

Désiré’s picture

No, the token issue above #1317926: menu_tokens function should not change the node object is not closed yet, so nor the latest release, nor the development snapshot of token module not contains the patch. So you need apply it.

froeser’s picture

Hi, thanks for the tip.
now it seems to work fine.

Only shadow on the whole thing is that I get following error message
Notice: Undefined property: stdClass::$uri in workbench_moderation_moderate_form_submit() (line 1635 of [drupalRootdirectory]/sites/[pathToMultiSite]/modules/workbench_moderation/workbench_moderation.module).

It appears after I assign 'published' to a draft and press 'apply'. The changes are done perfectly and the menu looks fine.

Frederic wbase’s picture

Thx, token tip worked great for me :-)

becw’s picture

Status: Reviewed & tested by the community » Closed (fixed)

It looks like this bug happened because of an issue with Token, so I'm going to close this issue now that the Token patch is committed. Thanks everyone!

kaidjohnson’s picture

We're encountering this issue as well on Drupal 7.16 using Workbench Moderation 7.x-1.2 and Token 7.x-1.4. We're also struggling with this issue: http://drupal.org/node/1408858 which makes it difficult to tell where things are going wrong.

We are on the latest dev of Entity API (7.x-1.x-dev, Oct 23) which was upgraded a few days before we started having this issue. Are other people still experiencing this issue? What version of Entity API are you running? I notice there was a big revision commit made to the Entity API on Sept 6: http://drupalcode.org/project/entity.git/commit/e7b054f but I'm not sure if that could possibly be related.

Our current workflow (as administrator):
- 'New Draft' of existing content with menu entry
- Change state to 'Published'
- Click 'Save'
- Automatically (and unfortunately) published to 'Draft'
- Go to revisions list, set to 'Published'
- Click 'Apply'
- Node is published, but no menu link
- Investigate 'New Draft' only to find default state of 'Create Menu Link' is unchecked

Thoughts?

jweowu’s picture

We were experiencing either this or a very similar problem with workbench_moderation 7.x-1.3 (both with token 1.4 and also with the latest token 1.x-dev release).

(I'm not sure whether it's exactly the same issue, as in our case the menu item was getting deleted even when setting the new revision directly to Published, which was not the case for the original poster.)

Reverting back to workbench_moderation 1.2 resolved it for us.

We're also using the following patch (for both 1.2 and 1.3).

; Expose workbench moderation states/transitions to features http://drupal.org/node/1314508
projects[workbench_moderation][patch][] = "http://drupal.org/files/workbench_moderation-featuresint-state-transition-1314508-22.patch"

And this one on 1.2 (but not on 1.3, as it had been committed by then):

; Update the Publishing options vertical tab summary in the node form: http://drupal.org/node/1615562
projects[workbench_moderation][patch][] = "http://drupal.org/files/1615562-vertical_tabs_summary.patch"
elvis2’s picture

@thekevinday Can you check your menu_links database table and see if your menu items are listed there? Look for the link_path to node/xyz. My hunch is that they are listed there...

===

I too ran into this problem recently and thought for sure something was broken.

To start off with, I do not believe "this issue", that thekevinday started with, is related to tokens. This issue really is not an issue but common behavior in Drupal. Let me explain...

The menu item is not deleted, as originally described, but definitely does not display if the node does not get published. But, if you check your menu_links table you will see your node <-> menu items there. So that tells us the menu item details go saved.

This node+menu behavior has been around since, maybe D4 or D5, if my memory serves me well. Out of the box Drupal allows for nodes to be assigned to a menu item. But, the menu item will not show up under your menu (admin area) or where ever your menu block (that list the menu items) until the node is published. Another way to say / think about this is: your menu item is not published (available to the world) until your node is published.

Until there is a workaround with workbench_moderation, editors have to go about creating and checking content differently. My temporary solution is to create the content with workbench_moderation in place, add the menu detail then publish it. Now go check the menu item is showing up in the right place and your content connected to the menu item is showing up too. If so, go back and unpublish the node so it can go through the moderation process. While you are on the node edit form, check your menu item details, you will see everything is still there. Or, the other option is to reverse the process and make the person who publishes the content check that the menu item is showing up in the right place and loading the node as well.

The optimal solution would be to have permissions in code (workbench_moderation) that if user has a certain role then then will see the menu item show up in the right place and that item will load the node associated with it (even though the node is not published). I have not delved into the code to know what all is necessary to make this happen, but it does seem like an easy solution.