I cannot find any case about this, but I get this message on the needs review and my content tab. I'm not sure what exactly this means nor what I can do to get rid of it.

Debug:
'Handler workbench_access_handler_field_section tried to add additional_field nid but node could not be added!'
in views_handler_field->add_additional_fields() (line 142 of sites/all/modules/views/handlers/views_handler_field.inc).

What should I do?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

cardentey’s picture

I have the same issue.

iStryker’s picture

What version of views are you using?

hass’s picture

Views 7.x-3.5

iStryker’s picture

Workbench does not work with views 3.5 (or the short lived 3.4). Can you check if #1782172: In views 3.5 Title etc are not showing anymore fixes this problem. I have recreated the default view for the Needs review tab (and My Drafts). The nid was on of the troubled field.

As for the My Content tab, you may still have a problem. My Content tab is a seperate view, which I have not changed.

hass’s picture

Rollback to Views 3.3? :-(

iStryker’s picture

The 'Need Reviews' and 'My Drafts' tabs are Workbench Moderation module
The 'My content' is Workbench module

Maybe an issue should be open in Workbench (if there is not one already)

h4rrydog’s picture

I tried applying the patch in #4 #1782172: In views 3.5 Title etc are not showing anymore but it did not fix the issue. Reluctantly rolled back to Views 3.3 which does restore functionality.

tkngdwn’s picture

This seems to be related to Workbench Access directly. I noticed in workbench_access_handler_field_section.inc that the table referenced is node_revisions, which should be node_revision. Changing this will display sections properly, however it also seems to cause a variant of duplicated items without any fields in the My Edits section. I'm still trying to figure out what could be causing it to spit out empty rows though.

hass’s picture

Project: Workbench Moderation » Workbench Access
Version: 7.x-1.2 » 7.x-1.0
tkngdwn’s picture

Ok, so I think I have a solution for this for Views 3.5. This fix sort of spans across Workbench, Workbench Access, and Workbench Moderation as it involves views provided by them. You may need to disable and re-enable the modules for the changes to take effect.

In workbench_access/views/workbench_access_content.view.inc

Change:

    if ($view->base_table == 'node_revisions') {
      $this->additional_fields['nid'] = array('table' => 'node_revisions', 'field' => 'nid');
    }

To:

    if ($view->base_table == 'node_revision') {
      $this->additional_fields['nid'] = array('table' => 'node_revision', 'field' => 'nid');
    }

Then for a very quick fix you can edit the views (workbench_edited, and workbench_moderation) provided by the Workbench modules, it will tell you it has fixed the relationships. You only then need to change the relationship for 'Content revision: Content' to be required and save.

To change this in the code you can do the following:

In workbench/workbench_edited.view.inc

Change:

/* Relationship: Content revision: User */
$handler->display->display_options['relationships']['uid']['id'] = 'uid';
$handler->display->display_options['relationships']['uid']['table'] = 'node_revision';
$handler->display->display_options['relationships']['uid']['field'] = 'uid';

To:

/* Relationship: Content revision: User */
$handler->display->display_options['relationships']['uid']['id'] = 'uid';
$handler->display->display_options['relationships']['uid']['table'] = 'node_revision';
$handler->display->display_options['relationships']['uid']['field'] = 'uid';
/* Relationship: Content revision: Content */
$handler->display->display_options['relationships']['vid']['id'] = 'vid';
$handler->display->display_options['relationships']['vid']['table'] = 'node_revision';
$handler->display->display_options['relationships']['vid']['field'] = 'vid';
$handler->display->display_options['relationships']['vid']['required'] = 1;

Append a line to the following field and filter sections:

Field: COUNT(Content: Nid):

$handler->display->display_options['fields']['nid']['relationship'] = 'vid';

Field: Content: Title:

$handler->display->display_options['fields']['title']['relationship'] = 'vid';

Field: Content: Type:

$handler->display->display_options['fields']['type']['relationship'] = 'vid';

Field: Content: Published:

$handler->display->display_options['fields']['status']['relationship'] = 'vid';

Field: Content: Updated date:

$handler->display->display_options['fields']['changed']['relationship'] = 'vid';

Field: Content: Edit link:

$handler->display->display_options['fields']['edit_node']['relationship'] = 'vid';

Sort criterion: Content: Updated date:

$handler->display->display_options['sorts']['changed']['relationship'] = 'vid';

Filter criterion: Content: Title:

$handler->display->display_options['filters']['title']['relationship'] = 'vid';

Filter criterion: Content: Type:

$handler->display->display_options['filters']['type']['relationship'] = 'vid';

Filter criterion: Content: Published:

$handler->display->display_options['filters']['status']['relationship'] = 'vid';

In workbench_moderation/views/workbench_moderation.view.inc

Change:

/* Relationship: Content revision: User */
$handler->display->display_options['relationships']['uid']['id'] = 'uid';
$handler->display->display_options['relationships']['uid']['table'] = 'node_revision';
$handler->display->display_options['relationships']['uid']['field'] = 'uid';

To:

/* Relationship: Content revision: User */
$handler->display->display_options['relationships']['uid']['id'] = 'uid';
$handler->display->display_options['relationships']['uid']['table'] = 'node_revision';
$handler->display->display_options['relationships']['uid']['field'] = 'uid';
/* Relationship: Content revision: Content */
$handler->display->display_options['relationships']['vid']['id'] = 'vid';
$handler->display->display_options['relationships']['vid']['table'] = 'node_revision';
$handler->display->display_options['relationships']['vid']['field'] = 'vid';
$handler->display->display_options['relationships']['vid']['required'] = 1;

Append a line to the following field and filter sections:

Field: Content: Nid:

$handler->display->display_options['fields']['nid_1']['relationship'] = 'vid';

Field: Content revision: Log message:

$handler->display->display_options['fields']['log']['relationship'] = 'vid';

Field: Content: Title:

$handler->display->display_options['fields']['title']['relationship'] = 'vid';

Field: Content: Type:

$handler->display->display_options['fields']['type']['relationship'] = 'vid';

Field: Content: Updated date:

$handler->display->display_options['fields']['changed']['relationship'] = 'vid';

Sort criterion: Content: Updated date:

$handler->display->display_options['sorts']['changed']['relationship'] = 'vid';

Filter criterion: Content: Title: (Note: There are three of these sections. Append to all.)

$handler->display->display_options['filters']['title']['relationship'] = 'vid';

Filter criterion: Content: Type: (Note: There are three of these sections. Append to all.)

$handler->display->display_options['filters']['type']['relationship'] = 'vid';

Filter criterion: Content: Published:

$handler->display->display_options['filters']['status']['relationship'] = 'vid';

If anyone wants to roll these changes into patches that would be great.

hass’s picture

Can you create patches, please? This is really heavy list of code changes to do by hand.

tkngdwn’s picture

The current 1.x Git version of Workbench Access actually already has the proper changes for the node_revision table. The patches for the other two are attached.

hass’s picture

Status: Needs work » Needs review

Modules are no longer usable and completly broken. Marking as critical. We need new releases.

Project: Workbench Access » Workbench Moderation
Priority: Normal » Critical
Status: Active » Needs work

The last submitted patch, workbench.patch, failed testing.

hass’s picture

Project: Workbench Moderation » Workbench
hass’s picture

#12: workbench.patch queued for re-testing.

Status: Needs review » Needs work

The last submitted patch, workbench.patch, failed testing.

hass’s picture

Project: Workbench » Workbench Moderation
Version: 7.x-1.0 » 7.x-1.x-dev
Status: Needs work » Needs review
FileSize
8.22 KB

Workbench core patch has been moved to #1792144: "My Edits" View is broken for green light.

Re-attaching for robot to get the green light.

hass’s picture

@tkngdwn: Your patch is working great for me! THX!!!

tkngdwn’s picture

Glad it worked. Makes upgrading the module easier for me in the long run. =D

hass’s picture

We definitively need new releases with this patches included! :-)

iStryker’s picture

Does this address comment #4 issue as well?

tkngdwn’s picture

I believe it does. That was one of the issues I was experiencing as well and it all seems ok now.

iStryker’s picture

Status: Needs review » Needs work

Nope! Does not solve comment #4 in #1782172: In views 3.5 Title etc are not showing anymore. You need to create a new relation from workbench_moderation_history.nid to node.nid, not node_revision.nid to node.nid which was one of the things I did in the other issue.

hass’s picture

Status: Needs work » Needs review

I see all titles. Clear your caches and reset your customized views, please. You may need to share some screenshots.

iStryker’s picture

If you publish something then save it as a draft or need reviews it doesn't show up

iStryker’s picture

Status: Needs review » Needs work
iStryker’s picture

Ok I have simplified my patch from #1782172

I've also change nid_1 field to nid

I believe there are alot of extra information in the default view, which should be stripped out, but I'll leave that for another issue

hass’s picture

Status: Needs work » Needs review

We should not mix issues. You may identified a bug, but it must be a different bug. Let's open a new issue, please.

romaingar’s picture

Hi,
THe patch is working for me but be careful to disable the module "content access", because it's not compatible with workbench moderation...

hass’s picture

How about writing some tests for these bugs? The module seems to have some real reliability issues to me. It's fairly difficult to trust that everything works properly. It least me is loosing trust.

iStryker’s picture

I have done some testing for Patch in #28

1.1 Create -> Save as draft (draft is default option)
My Edits: Present
All Recent Content: absent (until publish it queries node table not node revision)
My Drafts: present
Needs Review: absent

1.2 Create -> Save as draft -> Change to Needs Review
My Edits: present
All Recent Content: absent (until publish it queries node table not node revision)
My Drafts: present
Needs Review: present

1.3 Create -> Save as draft -> Change to Needs Review -> Change to Published
My Edits: present
All Recent Content: present
My Drafts: present (shows as published state) see #1630682: "My Drafts" tab should not list published content
Needs Review: absent

1.4 Create -> Save as draft -> Change to Needs Review -> Change to Published -> Click New Draft -> Save as Draft
My Edits: present (showing the published title and fields, but updated date of draft)
All Recent Content: present (showing the published title and fields, but updated date of draft)
My Drafts: present
Needs Review: absent

This is identical as Patch #18 except for 1.4 - My Drafts: absent
Cannot fix 1.1 & 1.2 All Recent Content, as this is part of the workbench module

Bevan’s picture

Taxoman’s picture

There is also patch/code in the duplicate issue mentioned in #33:
#1601036: Views: Use LEFT JOIN not INNER ,
- and ref. this Views issue:
#1766338: Incorrect filter group OR behavior, LEFT JOIN changed to INNER JOIN

oschuetze’s picture

The same error message will be still displayed on the tabs "My Drafts" and "Needs Review" of My Dashboard.
The other error messages have been solved successfully by this patch and this patch.

iStryker’s picture

@oschuetze is correct, one patch for workbench_moderation module, the other for workbench module.

tglynn’s picture

Version: 7.x-1.x-dev » 7.x-1.2
FileSize
11.46 KB

I manually applied the dev patch into my Workbench Moderation 7.x-1.1 code. It worked for me, so I've attached the patch here.

tglynn’s picture

I'm changing the version back to dev. Didn't mean to change the version for the whole topic.

Status: Needs review » Needs work

The last submitted patch, workbench_moderation_main_title_display-1781744-37.patch, failed testing.

hass’s picture

Status: Needs work » Needs review
tglynn’s picture

Here I have edited the file so that, hopefully, there are only unix line endings, as the patch check complained about a moment ago.

hass’s picture

Please stop posting patches for NON-DEV versions that clutters this case. Keep them on your computer.

Latest patch is in #28.

tglynn’s picture

edited

zunaeid’s picture

Version: 7.x-1.2 » 7.x-1.x-dev

There are two typos for node_revision.

http://drupal.org/node/1735382

This worked for me. Thank you

TimG1’s picture

+1 to #44. Looks like #1735382: Typo for node_revision in active section Views field handler has been committed.

Downloading the dev version of Workbench Access worked for me.

-Tim

rosborn’s picture

#44's solution worked for me as well. Trying to avoid going back to dev versions, so I hope this can be included in a new release soon.

Sborsody’s picture

Installing the dev version of Workbench Access as per #44 fixed the error for me yet now it isn't clear if the patch in #28 is really needed.

Views 3.5, Workbench Access 7.x-1.x-dev, Workbench Moderation 7.x-1.2

wrd’s picture

Installing dev version of Workbench Access solved the error problem for me, but also removed the option to select Taxonomy as an access scheme; can now only select Menu.

zhangtaihao’s picture

If updating Workbench Access to 7.x-1.x-dev fixes this issue, let's mark it as either "fixed" of "closed (duplicate)" (of #1735382: Typo for node_revision in active section Views field handler). Never mind.

zhangtaihao’s picture

#28 fixes the missing columns. Some issues noted:

  1. The new relationship label has an extra trailing space ("Node ").
  2. The displayed title belongs to the published revision (or is this a non-point for this issue? perhaps for #1789296: Should the title be link to the original node or the revision?).
  3. Editing the view immediately marks the view as "changed".

I suspect the third point can be solved simply by re-exporting the view entirely.

Also, I should probably point out that Views 7.x-3.5+6-dev has the new node-revision relationship using "nid" instead of "vid". Might it be worth using that instead?

operinko’s picture

As for the view issue, it seems that the "Editing marks it as 'changed'" issue is caused by some missing/wrong relationships (I seem to recall a message about Views having added missing relations automatically)

agentrickard’s picture

I'm coming into this issue cold, but with commit access.

I cannot replicate the issue, using:

  • Workbench Moderation 7.x.1.x -dev
  • Workbench Access 7.x.1.x -dev
  • Workbench 7.x.1.x -dev
  • Views 7.x.3.x -dev

Can someone provide simple steps to replicate?

I need explicit lists of modules and versions. Actions taken. URLs where the error appears. Etc.

bbinkovitz’s picture

I replicated this issue using Workbench 7.x-1.x-dev and Views 7.x-3.x, but it did not persist when I switched from Views 7.x-3.x-dev. I think it's a Views issue that was fixed in dev.

hass’s picture

Workbench Moderation 7.x-1.2
Workbench Access 7.x-1.0
Workbench 7.x-1.1
Views 7.x-3.5

agentrickard’s picture

Thanks. If it's a Views issue, I don't know what we can do about it except nudge the Views maintainers.

rosborn’s picture

I thought this was a Workbench Access issue #1735382: Typo for node_revision in active section Views field handler, which has now been fixed. Fixing the typo referenced there (see #44) got rid of the error message that was listed in the initial issue. The problem for me is that Workbench Access hasn't had a release since August 2011, and I'm not willing to go back to dev versions on my production site.

agentrickard’s picture

@rosborn

There are issues in the Workbench Access queue marked "Needs Review" -- they are release blockers. -dev is perfectly stable if you are using Taxonomies.

hass’s picture

This here is not an issue of workbench access and and upgrade to dev does not solve the issues reported here!

mpruitt’s picture

#12: workbench.patch queued for re-testing.

hass’s picture

Latest patch in #28 has a problem, but I'm not sure if we should handle this here. This can be a follow up issue.

In admin/workbench/needs-review a user will see all nodes from all sections he is assigned, too. But this user do not have permission to change moderation state of any of this nodes. He is only able to change moderation state on his own nodes. This nevertheless show the Draft link in Moderation column.

A node should only be listed in admin/workbench/needs-review if the user has permission to change the moderation states.

I'm reattaching the latest patch (unchanged) from #28 as it may not clear to many that this is the LATEST patch and I hate reading all again and again.

hass’s picture

Status: Needs review » Reviewed & tested by the community

Works all as required and fixes tons of issues. Other bugs can be handled in follow up issues.

Let's make this modules usable and commit this patches + release a new version now, please.

hass’s picture

stevector’s picture

Issue tags: +Workbench Sprint

Tagging for Workbench Sprint to get this resolved this week.

stevector’s picture

Status: Reviewed & tested by the community » Needs review
FileSize
31.72 KB

After applying this patch and clicking edit on the View I'm still getting a notice that there are unsaved changes. After reexporting I get a number of lines changed in the diff. hass, are you seeing the same behavior?

Here's the re-exported patch. I made no manual changes, just applied #60, hit edit and hit save. I'm on a git checkout of Views 7.x-3.x.

Also can you jump in #drupal-workbench to discuss issues tagged with the "Workbench Sprint."

hass’s picture

That's correct. There have been changes in the views api. The previous patch only fixed the issues, but I'm fine if we export the full view. That does not change anything, but bring us on top of latest views changes.

We can see the same in #1569698: Re-export default Views and I noted this in #1630682: "My Drafts" tab should not list published content

stevector’s picture

Also hass, in 58 you mention that the dev version of Workbench Access doesn't fix the error message reported here. Is that right?

I am not seeing "Handler workbench_access_handler_field_section tried to add additional_field nid but node could not be added!" As has been mentioned by other commenters, that error message should have gone away with http://drupal.org/node/1735382 which is in the dev version of Workbench Access.

hass’s picture

Last test was made with WBA 7.x-1.0+35-dev + a view patches like the one mentioned from queue. Will update now. I just tested all with latest DEV and confirmed that this does not fix the issue here without the patch applied from this case.

There are table column values missing in needs review and draft view and so on and so on.

hass’s picture

Assigned: Unassigned »
+++ b/workbench_moderation.views.incundefined
@@ -43,6 +43,17 @@ function workbench_moderation_views_data() {
+          'label' => t('Node '),

need to remove the space

+++ b/views/workbench_moderation.view.incundefined
@@ -486,7 +372,12 @@ $translatables['workbench_moderation'] = array(
   t('You haven\'t created or edited any content.'),
+  t('Node '),
   t('revision user'),
   t('Nid'),
   t('Log message'),

same

hass’s picture

FileSize
31.71 KB

Fixed patch directly

stevector’s picture

So hass, you are seeing somewhere the error message "Handler workbench_access_handler_field_section tried to add additional_field nid but node could not be added!"

Can you give me more specific instructions for how to reproduce that specific error? Or is the title of this issue just out of date?

hass’s picture

Reproduced all again with WB 1.1, WBM 1.2, WBA 1.0:

URL admin/workbench/drafts

Debug:
'Handler workbench_access_handler_field_section tried to add additional_field nid but node could not be added!'
in views_handler_field->add_additional_fields() (line 142 of sites\all\modules\views\handlers\views_handler_field.inc).

URL admin/workbench/needs-review

'Handler workbench_access_handler_field_section tried to add additional_field nid but node could not be added!'
in views_handler_field->add_additional_fields() (line 142 of sites\all\modules\views\handlers\views_handler_field.inc).

Additional:
admin/workbench/needs-review and admin/workbench/drafts is completely broken. Many columns are missing text.

hass’s picture

Reproduced all again with WB 1.1, WBM 1.2, WBA 7.x-1.0+55-dev:

'Handler workbench_access_handler_field_section tried to add additional_field nid but node could not be added!'
in views_handler_field->add_additional_fields() (line 142 of sites\all\modules\views\handlers\views_handler_field.inc).

Issues disappeared on Needs review and Draft pages.

Stil broken:
admin/workbench/needs-review and admin/workbench/drafts is completely broken. Many columns are missing text.

We used this case title to catch the people who are running official released versions. Changing the title now.

hass’s picture

Title: Handler workbench_access_handler_field_section tried to add additional_field nid but node could not be added! » Draft and Needs review pages are broken

Reproduced all again with WB 1.1, WBM 7.x-1.2+9-dev, WBA 7.x-1.0+55-dev:

No changes to #72

hass’s picture

Reproduced all again with WB 7.x-1.1+7-dev, WBM 7.x-1.2+9-dev, WBA 7.x-1.0+55-dev:

URL admin/workbench:

Debug:
'Handler views_handler_field_node_revision tried to add additional_field language but node could not be added!'
in views_handler_field->add_additional_fields() (line 142 of sites\all\modules\views\handlers\views_handler_field.inc).

This is #1792144: "My Edits" View is broken.

Workbench Moderation - Draft and Needs review pages, no changes - still broken.

hass’s picture

Note, all these tests have been made with latest Views DEV.

stevector’s picture

Status: Needs review » Fixed
stevector’s picture

I did one more commit to take out the Aggregation settings because they aren't getting used anywhere and clutter the UI.

http://drupalcode.org/project/workbench_moderation.git/commitdiff/059925...

cweagans’s picture

For anyone finding this later, to make this message go away, you have to upgrade both workbench and workbench moderation to the -dev releases until there's a release after today's date.

hass’s picture

Do not miss Workbench Access DEV...

capellic’s picture

I just discovered Workbench and Workbench Moderation a couple of days ago and stumbled upon this problem. I found this case and others and was very happy to read #78. I updated to the dev versions and all is working as expected. THANKS!

romaingar’s picture

HI,
I used an older version of WB, WB Access and WB Moderation. ANd i had some problems with the view "need review". I have uninstalled these 3 modules and enabled the new one. Now it's strange... in the view admin i can view my results in the preview area, but not inside the page.... even if i'm connected as admin.
I've seen that some exposed filter are added to the view (section) "need review".
On the other hand i use domain access module, maybe it's the cause.

Sorry for my poor english... an if it's not the good place to post this.

stevector’s picture

Hi Romaingar,

Since this issue is marked as fixed, I recommend opening as separate support issue.

Automatically closed -- issue fixed for 2 weeks with no activity.