Hi,

i found a bug.

If ich change the access right insight dbfm of a file or directory away from the default, i get an error.

_detailed_
If i change the access rights of a file - tab [read/ Write access] to "Restricted, writeable to the fileowner (and the rolles and groups detailed below - optional" to a role, the dbfm shows no error. But if reload the dbfm or access any other contend in my drupal i get a red box with the follwing error:

* warning: array_diff() [function.array-diff]: Argument #1 is not an array in /etc/drupal/5/sites/all/modules/dbfm/dbfm.module on line 4066.
* warning: array_diff() [function.array-diff]: Argument #2 is not an array in /etc/drupal/5/sites/all/modules/dbfm/dbfm.module on line 4067.

Any ideas?

Con

CommentFileSizeAuthor
#9 patchAsFile.txt3.18 KBgeoff_eagles
#4 dbfm.module.patch4.2 KBgeoff_eagles

Comments

rooey’s picture

Hi,

Could you tell us, step by step, what you do to produce this error?

Kindest.
M.

geoff_eagles’s picture

Thanks for reporting the bug. I see the error following the steps you gave. Our servers have their warning messages switched off which is probably how rooey missed them. I'll get back to you later today when I can see how to fix the problem.

geoff_eagles’s picture

Essentially the problem comes about because you're not using organic groups for permission control on your server. This is supposed to be an optional module for dbfm but it seems as though you need it to avoid getting error messages. I'll add a test in the code on whether you're using the groups module which will prevent the error messages. Expect a patch after I've had some lunch.

geoff_eagles’s picture

Status: Active » Patch (to be ported)
StatusFileSize
new4.2 KB

OK - here's a patch which cures the problem.
You MUST apply the previous patch (posted Apr 3rd) before you can use this one.
Just pop the patch into your module directory and type:
patch < dbfm.module.patch

conloos’s picture

Thanks 1000 times,

i didnt resive a mail from drupal.org, if anybody creates a replay ... sorry.
In the last week i setup a second drupal5 install, because i hoped it is a problem between the installation trys of different modules. I test the patch today.

Thanks Con

conloos’s picture

Title: Access permission failure » access right failure

Ok i applied the two patches.

i get:

patch < dbfm.module.patch
patching file dbfm.module
root@drupal5:/etc/drupal/5/sites/all/modules/dbfm# patch < dbfm.module.patch2
patching file dbfm.module
Reversed (or previously applied) patch detected!  Assume -R? [n] y

i checked the dbfm, and the second patch wasnt full present, so i merged by hand:

   1075       //just check we haven't ended up with a double slash at the front if so, strip it off
   1076       str_replace('//','/',$pathin);
   1077
   1078       $pathvet = mysql_real_escape_string($pathin);
   1079       if (($path_rec = dbfm_selected_file_record('', $pathvet, $err)) != FALSE) {
   1080         //check it's a directory and not a file or version
   1081         if ($path_rec->fmime != 'directory') {
   1082           //Changed by mike.
   1083           //If the specified URL is a file or version, DBFM will now open it instead of displaying the parent directory.
   1084           drupal_goto('dbfm_send/'.$path_rec->fid);
   1085           return;  //we don't carry on and launch the application

After that i restart drupal and tryed:

    * warning: array_diff() [function.array-diff]: Argument #1 is not an array in /etc/drupal/5/sites/all/modules/dbfm/dbfm.module on line 4067.
    * warning: array_diff() [function.array-diff]: Argument #2 is not an array in /etc/drupal/5/sites/all/modules/dbfm/dbfm.module on line 4068.

I get the upper error only if i changed to any other side the first time, but than the error vanished. Before your patches i got the error on every (side) change.

I didnt activated og!!

I tryed the og, but it is to complex for the users of this project, so i didnt want to use it. Is it a strong depancy to enable og? Or is this a last "simple" bug?

Thanks con

avpaderno’s picture

Title: access right failure » Access permission failure
conloos’s picture

Title: access right failure » Access permission failure

Hi,

I installed OG, but the error is still present. In the file properties window I didnt have a workgroup menu?!

Con

geoff_eagles’s picture

StatusFileSize
new3.18 KB

I think the patching is screwy. I've tested again here but I wasn't able to duplicate the problem you had when you applied your patch.
I've attached the function that needs patching as a file. If you could just cut and paste that over the same function in your dbfm.module file it should work without errors.

conloos’s picture

it works ...

no failures and working right permissions :o)

Thank you!!!

con

conloos’s picture

Status: Patch (to be ported) » Fixed

Status: Fixed » Closed (fixed)

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