This is a really helpful module. A million thanks!

When I logged in as root user, trying to edit a content type that is set as not allow to upload file, I got the following warning:

warning: array_intersect() [function.array-intersect]: Argument #2 is not an array in .../sites/all/modules/upload_perm_per_type/upload_perm_per_type.module on line 92.

Any resolution?

Comments

jim kirkpatrick’s picture

Bug confirmed on editing node... Will attempt a little debugging soon-ish.

jim kirkpatrick’s picture

Status: Active » Needs review

I've fixed this on my machine with a minor change... Essentially, the module was getting a Drupal variable and checking it with array_intersect(), but the default value used in case the variable wasn't present was NOT an array...

In other words, line 91 should read:

    $allowed_roles = variable_get("upload_perm_roles_$type", array());

So that it returns an empty array in case no variable upload_perm_roles_$type exists, rather than '1' as per the current code.

I don't do patches, sorry! But this is a 5 second fix...

ClearXS’s picture

warning: array_intersect() [function.array-intersect]: Argument #2 is not an array in upload_perm_per_type/upload_perm_per_type.module on line 92

Therefor I had a strange error that with an error message that my editing was on my other mediawiki site, as messaged by Drupal(!):

Fatal error: Call to a member function getTitle() on a non-object in 'my-mediawiki.site'/includes/EditPage.php on line 97

Don't know if that came because I tried to implement this:
ONLY show modules/themes/libraries/plugins file contents - http://drupal.org/node/30334#comment-3511962
...or that the cause was this module or another..?

=> applied the patch =>

Fatal error: Call to a member function getTitle() on a non-object in 'my-mediawiki.site'/includes/EditPage.php on line 97

line 96      if (empty($intersection) && $user->uid != 1) {
line 97       $form['attachments']['#access'] = 0;

I have restored the original .htaccess that never mentioned 'my-mediawiki.site'; will do some cache clearing and rebuild permissions again to be sure =>

Keeps looking on the non-Drupal site for editing! How can I get rid of this..?

Have it on all pages if I want to edit, so also pages that I never have used while I had that different .htaccess in the modules subdirs

=> ticked module off (don't know why it was ticked on; I can't recall I did that) => uninstall => Don't see the module back under admin/build/modules/uninstall while its ticked off => same errors remain

actually 'my-drupal.site'/includes/EditPage.php does not even exist on the real drupal site!

extracted an original D6.19 and does not exist that file either...

BUT YES: that file exist on my other mediawiki site that is on another dir on my webhost!!!

How could this be possible and how do I get rid of it?

=> found the cause: MediaWiki » Issues - Editing any node gives this error - http://drupal.org/node/277416

Think it is independent of "Upload Permissions Per Content Type" as I have disabled it? Or is it still active, as I could it didn't show up to uninstall?