Problems with many modules (FastToggle, Draggable Views, Editable Fields...)

asxnot - October 7, 2009 - 20:36
Project:Web File Manager
Version:6.x-2.9-alpha2
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:needs work
Description

After very long testing we found out why on our site (www.acpadova.it) the webfm attachments suddenly disappear from some pages.

The problem is the interaction of WebFM with some of the modules that we are using as FastToggle or Draggable Views. When one of this modules modifies a page, for example by promoting it in home page (fasttoggle) or by altering a CCK numeric field (Draggable Views), all the attachments are detached from that page ( we discovered that a DELETE query is performed on table webfm_attach by means of a guard on the database). The same behavior has been observed when using the Editable Fields module.

I suppose that the problem is in javascript but I am not a programmer and have no clue on what part of the js code is involved.

#1

asxnot - October 8, 2009 - 14:37

Another fact: the attachments disappear even when using the core promote/demote operation at /admin/content/node.

Did anybody report similar behaviors?

#2

asxnot - October 8, 2009 - 15:54
Status:active» needs review

I think I found where the problem is.

At line 427 of webfm.module (in function webfm_nodeapi) there is the following condition:

      if(user_access('access webfm')) {

I think that, similarly to what happen at line 320 for function webfm_comment,
the condition should be instead:

      if(user_access('access webfm') && array_key_exists('attachlist', $_POST)) {

Can anybody check my supposition?

#3

Niels Hackius - October 10, 2009 - 12:04

#4

Niels Hackius - October 10, 2009 - 12:04
Version:6.x-2.11» 6.x-2.9-alpha2
Priority:critical» normal
Status:needs review» needs work

You are right. Please make a patch from this (http://drupal.org/patch/create)

Thank you very much :-)

As stated in the code:

      // If the user cannot access webfm, $_POST['attachlist'] is always empty
      // and therefore will delete existing attachments from the node.

... However this doesn't mean vice versa is true.

#5

asxnot - October 10, 2009 - 15:12

Here is the patch.

AttachmentSize
webfm_row427.patch 623 bytes
 
 

Drupal is a registered trademark of Dries Buytaert.