I cannot upload attachments to Doc Pages. I guess that's to do with the D6 upgrade?

Else I am not sure if I have enough rights to do this. If this is the matter, please add me to the Role that can attach images to Doc Pages.

Comments

johnnoc’s picture

Issue tags: +drupal.org upgrade

I think this has to do with the d.o. upgrade.

gábor hojtsy’s picture

Issue tags: -drupal.org upgrade

This code was in the drupalorg.module before the upgrade even, and it did not change a bit (therefore removing tag):

  // List of forms to check for overrides, and the corresponding permissions.
  $override_forms = array(
    'book_node_form'       => 'edit book pages',
    'forum_node_form'      => 'administer nodes',
    'page_node_form'       => 'administer nodes',
    'simplenews_node_form' => 'create newsletter',
    'story_node_form'      => 'administer nodes',
  );
  // Override the access for attachments if it's a forbidden form,
  // and the user does not have sufficient permissions.
  if (in_array($form_id, array_keys($override_forms)) && !user_access($override_forms[$form_id])) {
    if (isset($form['attachments']['#access'])) {
      $form['attachments']['#access'] = FALSE;
    }
  }

Not sure who added it and why, but you can make out the exact required permissions for each node type. Maybe with the more fine-grained permissions in D6, we can update/revise this list.

eigentor’s picture

If you can set the permissions somewhere: Please allow File attachments for me for book pages.

If I get you right this is possible?
If not, quite some other people should be affected by this and it will need a more general solutions.

I don't know the exact roles needed for that, so maybe Addi should have a look, she should know which role was needed before the upgrade.

johnnoc’s picture

This is a bug which came up after the upgrade. I have Docs Team and Site Maintainer roles, and when I edit a book page now I cannot upload attachments anymore.

Can anybody from the Docs team confirm this? Please check if you can attach files to book nodes. Tnx

gábor hojtsy’s picture

As said in #2 above, the code is the same, but the sets of available permissions changed from 5 to 6.

add1sun’s picture

Project: Documentation » Drupal.org site moderators
Component: Other documentation issues » Other

the new perm name should be 'book_node_form' => 'edit any book content'

I don't have time to make a patch. we should also remove the simplenews line since we aren't using it anymore. moving this to the webmasters queue queue so we can get this fixed asap. (I tried to put it in the drupalorg.module queue but it didn't come up in the Project autocomplete.)

quicksketch’s picture

Title: No Attachments on Doc Pages possible? » Attachments are Disabled on Book Pages
Project: Drupal.org site moderators » Drupal.org customizations
Component: Other » Code
Status: Active » Needs review

It's not a proper patch, but I don't know where or if I can get access to the drupal.org custom module source code. Please make the change add1sun recommends to the drupalorg.module so that attachments are enabled for book pages:

   // List of forms to check for overrides, and the corresponding permissions.
   $override_forms = array(
-    'book_node_form'       => 'edit book pages',
+    'book_node_form'       => 'edit any book content',
     'forum_node_form'      => 'administer nodes',
     'page_node_form'       => 'administer nodes',
dww’s picture

dww’s picture

Status: Needs review » Needs work
Issue tags: +drupal.org upgrade

BTW, this code in drupalorg.module was from the D5 days when there was no way to give fine-grained access control to what node types users are allowed to upload files to. Once we changed project_issue to use the upload and comment_upload modules, there was no way to give authenticated users permission to attach files to issues without giving them the blanket "upload files" permission. But, that'd let all authenticated users attach files to forums and book pages, too, which was deemed undesirable. So, we added this code in here to prevent access except for special users on certain forms. So, this *is* a bug from the d.o upgrade, since the permissions changed and this code was never ported to D6...

Given that, the change proposed in #7 is (I believe) incorrect. That's going to give all auth users the permission to attach files to book pages. Do we really want that? Seems like we should check for a permission here that only the special Doc team folks have, since auth can now "edit any book content". Seems like being on the doc team now just gives you the power to "revert revisions". Should we tie this feature to that permission for the purpose of editing book pages?

webchick’s picture

Status: Needs work » Needs review
StatusFileSize
new877 bytes

Wow, this is a stupid bug. I just lost 10 minutes searching fervently around trying to figure out why I couldn't see this field, why even though it was enabled at admin/content/types/book I *still* couldn't see it, etc. I shudder to think at how many critical resources are off on some external server somewhere that could fall off the Internet at any time because of it. :(

I spoke with Addi. Apart from access to the Documentation input format, the only other difference is 'revert revisions' permission, so that's what the patch is based on.

If we could fast-track this commit, that would be wonderful.

add1sun’s picture

Status: Needs review » Reviewed & tested by the community

Yep, I'm cool with this and agree that we need this in sooner rather than later. It had fallen off my radar but this is crippling to docs.

webchick’s picture

Priority: Normal » Critical
Status: Reviewed & tested by the community » Needs review

Escalating to critical because:

a) The current behaviour is completely broken. The "edit book pages" permission doesn't exist anymore, and as a result Dries Buytaert is the only person who can upload images on book pages on Drupal.org. :P

b) This represents a major roadblock to any kind of serious documentation work. I'm in IRC with someone right now who wants to add a tutorial to the handbook with 32 screen shots. His options are either link to the images off-site, or upload them to groups.drupal.org/the issue queue. Both of which are completely stupid.

webchick’s picture

Status: Needs review » Reviewed & tested by the community

Oops. Cross-post reset status.

dww’s picture

Status: Reviewed & tested by the community » Fixed
Issue tags: +needs drupal.org deployment

Committed to HEAD + DRUPAL-6--1, and applied locally on d.o. This should be deployed for real via SVN, but I didn't feel like importing the whole thing just for this change.

webchick’s picture

Awesome!! Thank you so much, dww! :D

quicksketch’s picture

Thanks, much appreciated webchick and dww.

Status: Fixed » Closed (fixed)

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

dww’s picture

Issue tags: -needs drupal.org deployment

Officially deployed...

  • Commit 6836f61 on 6.x-3.x, 7.x-3.x-dev by dww:
    #379072 by webchick, dww, et al: Allow doc team members to attach files...