Error when no roles have permission to upload files

webchick - May 31, 2008 - 23:18
Project:Upload Permissions Per Content Type
Version:6.x-1.0-beta1
Component:Code
Category:bug report
Priority:normal
Assigned:Dave.Ingram
Status:active
Description

When there are no additional roles beyond anonymous and authenticated, you get the following at the settings page:

    * warning: array_fill() [function.array-fill]: Number of elements must be positive in /Applications/MAMP/htdocs/porting-5x/sites/all/modules/upload_perm_per_type/upload_perm_per_type.module on line 50.
    * warning: array_fill() [function.array-fill]: Number of elements must be positive in /Applications/MAMP/htdocs/porting-5x/sites/all/modules/upload_perm_per_type/upload_perm_per_type.module on line 50.

#1

webchick - May 31, 2008 - 23:23
Title:Error when no roles» Error when no roles have permission to upload files

Oops. I mistook the cause of the error.

#2

Dave.Ingram - May 22, 2009 - 14:47

If this remains a problem for anyone in the 6.x branch then please re-open the issue there. Thanks!

#3

Dave.Ingram - May 22, 2009 - 14:48
Status:active» closed

Marking as closed

#4

GrimSage - May 24, 2009 - 11:16
Version:5.x-1.x-dev» 6.x-1.0-beta1
Status:closed» active

This remains an issue for version 6, except it is only if no roles, unlike the description it ONLY happens if no roles have upload permissions

warning: array_fill() [function.array-fill]: Number of elements must be positive in (...)upload_perm_per_type/upload_perm_per_type.module on line 48.

I have made a dirty hack to stop the errors from showing, but wonder if there could be a cleaner way

AttachmentSize
diff-upload_perm_per_type_upload_perm_per_type.module.diff 951 bytes

#5

Dave.Ingram - May 24, 2009 - 13:21
Assigned to:Anonymous» Dave.Ingram

Thanks. You're on the right track but I think we can do it a little cleaner. I'll see if I can get a patch worked up and committed this afternoon.

#6

Dave.Ingram - May 24, 2009 - 18:08

Hmm.. I was trying to recreate this and I didn't get this error. Do you get it when viewing the page? or when submitting it?

#7

GrimSage - June 6, 2009 - 05:18

when viewing. Usually it is when I have started a site from scratch and have not gotten around to adding upload permissions to any roles. I didnt test with the built in content types but I do notice it with cck content types

#8

arvati - July 16, 2009 - 16:10

I have the same problem. Since I don know how to apply thr diff file i still not ablle to test the solution on drupal 6.
Once I create a role with permission to upload file the error went away...

 
 

Drupal is a registered trademark of Dries Buytaert.