So it sounds like it's supposed to be possible but I can't find a way to access the WebFM db tables in views.

WebFM 6.x-2.11
Views 6.x-2.x-dev
Core 6.13

HELP!?

Comments

milos.kroulik’s picture

I don't know, if this module has native Views integration, but you can always use Table wizard module: http://drupal.org/project/tw

anijmeh’s picture

I just installed this module for the first time and while I was immediately impressed I noticed the views api is still written in views 1. I was thinking of doing the conversion to views 2 but i'm not sure if anyone has stepped in yet to take over maining this project. I'll take a look at what's involved.

shima’s picture

I think I want to do something like this
I want to view every sub directory in its node
for example:
we have ((directory1/directory2/directory3)) and ((node1/node2/node3))
I want show just (directory2/directory3) in (node2) like structure in "/webfm'' page
how can I do this?

I install 'tw' module and in 'Table Wizard' part i add 'webfm_file' and 'webfm'_ipfolder tables and Export views definitions for selected tables then "Views definition for hook_views_data()" present
now how can i use it

help me pleas soon

anijmeh’s picture

StatusFileSize
new3.57 KB

I put together a quick and dirty Views2 conversion for webfm for my own purpose. I left out the all_files field which is now obsolete since the same result can be achieved by creating a node relationship.

1. Unzip these files into the webfm module directory
2. add the following code to the bottom of webfm.module

function webfm_views_api() {
return array(
'api' => 2,
'path' => drupal_get_path('module', 'webfm'),
);
}

3. Clear cach (under settings/performance)

shima’s picture

tanks alot :)

robmilne’s picture

Status: Active » Fixed

In head - I added a 'views' folder so the path indicated in comment#4 has changed.

I'd appreciate it if others test this and post back any fixes since I'm not a views user and have no time to start down that road. I'd also appreciate if someone would audit whether WebFM security is defeated by views - I assume it is.

erald’s picture

Hello,

I am trying to test this patch but can not get it working.
Am a bit puzzled about comment #6. I added the views folder but am not sure what to put there and how to change the path (just add .'views/' ?)
also I did put the files in there but it simply seem not to work and since I am not really familiar with the drupal system I have no idea where to look. If someone can help then I am more than willing to test it further. But now I do not have anything in views.

thanks

robmilne’s picture

On the WebFM project page is a link called 'Browse the CVS repository'. That is where you will find the latest versions of the files.

erald’s picture

OK found it.
Found some problems with broken fields but probably because those are empty. Will test this a bit more and come back on it later.

Most of my problems I solved by using some custom code in the webfm module, but rather rebuild everything in views.

Thanks will come back if I find any problems

Status: Fixed » Closed (fixed)

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

webservant316’s picture

Is this patch OR the ability to display webfm files from Views soon to be included in the module release?

roball’s picture

Title: OK, how do I list WebFM files in Views? » Support for Views module
Status: Closed (fixed) » Active

Support for the Views module now got into the official release 6.x-2.12 :-)
When creating a new view,the "View type" list of radio buttons now contains "WebFM Files".

However, I am observing the following errors:

  • When I select "WebFM Files: File Description" from the "Fields" section, I am getting the error "Error: handler for webfm_file > fdesc doesn't exist!".
  • When I select "WebFM Files: File Language", I am getting the error "handler for webfm_file > flang doesn't exist!".
  • When I select "WebFM Files: File Publisher", I am getting the error "Error: handler for webfm_file > fpublisher doesn't exist!".
  • When I select "WebFM Files: File by Name/Title.", I am getting the error "Error: handler for webfm_file > file_name doesn't exist!".
  • When I select "WebFM Files: Title", I am getting the error "Error: handler for webfm_file > ftitle doesn't exist!".

Thus, the only working fields from the "WebFM Files" group are: "WebFM Files: Download Count", "WebFM Files: File Creation Date", "WebFM Files: File Size", "WebFM Files: File path" and "WebFM Files: Mime/Type".

Unfortunately, it is not possible to display the File ID (fid) nor a link to the download URL (webfm_send/[fid]).

nhck’s picture

Version: 6.x-2.11 » 6.x-2.12
Component: User interface » Code
Category: support » bug

Thank you for report this bug Robert,

I can confirm this - webfms views handlers are not properly included for some reason.

Setting this to a bug report.

nhck’s picture

Title: Support for Views module » Views Handlers are broken
nhck’s picture

Status: Active » Needs review
Issue tags: +views, +files
StatusFileSize
new1 KB
new5.79 KB

Thanks everyone for reporting this. The views handler was not implemented correctly.

I have created a patch and it would be nice if someone could test it. (You can read on how to apply patches here: http://drupal.org/node/60108)

There are two patches, you need to apply both.

  • The first one makes some path corrections and some other stuff. (554430-15-part1-webfm-views.patch)
  • Part 2 patches webfm_views.inc which at first must be renamed to webfm.views.inc.

All in all I think there is major work to be done in this area, e.g. the large commented area in webfm_views.inc? Also why don't we hook into the existing file view-thingy?

robmilne’s picture

Status: Needs review » Fixed

fixed in head. I'm not a views user so I haven't looked at this critically - I'm relying on views users to verify proper functioning

Status: Fixed » Closed (fixed)

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

mpotter’s picture

Status: Closed (fixed) » Reviewed & tested by the community

I was able to successfully apply your patches to the 6.x-2.12 version and it fixed the problem with the Description and Title fields. Links are also properly displayed.

I had a bit of trouble with the "Part2" patch because it refers to the file location "webfm-HEAD/views/webfm_views.inc" and gave me an error about not having the "webfm-HEAD" directory. Once I edited the patch file and removed that, then I could run the patch (on the not-renamed file), and then I manually renamed the file.

Note that after applying these patches you need to clear the Views cache (I also cleared other caches just in case).

Definitely an improvement over the current 6.x-2.12 version, so unless others want to test this more, go ahead and apply it.

mpotter’s picture

Honestly though, the method of selecting an entirely new View type of WebFm is not the way this should be done. If I attach WebFm files to a Node, then I should be able to access the WebFm fields via a normal relationship in the Node View, just like how the existing file attachments work.

For example, my File Nodes have a name, description, image, version number, etc. All with CCK fields. If I use a normal File Attachment field, then I can display the files in a custom View. But I cannot access any files attached via WebFm in this way unless I print the entire Node, which defeats the entire purpose of the View.

So the fields in the WebFm table really should be implemented as normal View Fields as described in the Views 2 Advanced Help documentation. Perhaps this will get done with the Drupal 7 rewrite.

ianchan’s picture

subscribe

paranormals’s picture

Just ran into this same limitation the way WebFM is implemented in Views also. :-\

Subscribing..

nhck’s picture

Status: Reviewed & tested by the community » Postponed

You both are looking for this: #446818: Use the Drupal "files" Table for file records ..and i am sorry to say that filefield isn't implemented in Webfm yet :-/

codigovision’s picture

StatusFileSize
new940 bytes

i edited the part 2 patch so that it works if you manually change the file name first

www.codigovision.com

nhck’s picture

Sorry, I don't understand?

codigovision’s picture

@#24 well the patch 2 didn't work because of the path, and it seemed we were supposed to manually change the name of the file, looking back i guess the patch did that, and you were just letting us know what it did. Anyway i just adjusted the path and took out the renaming part, renamed the file manually and it worked great.

I also copied some other functions from the views.field.inc and got some of the other filters to work, but not all of them, I imagine someone who knew a little more than me could add all of them pretty easily, and that would give it a more complete views implementation.

nhck’s picture

Ah yes thank you Codigo Vision I just wasn't sure if I understood the intend of the patch. Anyway thank you for helping - we have this in head already.

lilon’s picture

subscribing

lewie6’s picture

great module, i think i have a similar issue, i tried to create a view 4 fields:

File Creation Date
File by Name/Title.
File path
File Size

The above work fine, but I want to add the username, so i add a relationship to: 'WebFM Files: User ID'

then i get error...

user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ORDER BY webfm_file_fcreatedate ASC LIMIT 0, 10' at line 8 query: SELECT webfm_file.fid AS fid, webfm_file.fcreatedate AS webfm_file_fcreatedate, webfm_file.fpath AS webfm_file_fpath, webfm_file.fpublisher AS webfm_file_fpublisher, webfm_file.fsize AS webfm_file_fsize FROM webfm_file webfm_file LEFT JOIN user user_webfm_file ON webfm_file.uid = user_webfm_file. ORDER BY webfm_file_fcreatedate ASC LIMIT 0, 10 in C:\wamp\www\sites\all\modules\views\includes\view.inc on line 771.

i am using version: 6.x-2.x-dev. am i doing something wrong?

Note i also tried version 6.x-2.12, and that wouldn't even let me add these fields to a view:

File Creation Date
File by Name/Title.
File Size

nhck’s picture

lewie6, thank you for reporting this and helping to make webfm better. I've commited a fix for this to cvs. You either get it from there or wait until the dev release is being rebuilt.

lewie6’s picture

Wow! amazing! fixed in less than 1hr!

scjv’s picture

Version: 6.x-2.12 » 6.x-2.13-beta1
Status: Postponed » Active

same problem with 6.x-2.13-beta1

Drupal core 6.20
Views 6.x-2.12
CCK 6.x-2.8
...

nhck’s picture

Status: Active » Postponed

What "same problem "?

scjv’s picture

Status: Postponed » Active

So it sounds like it's supposed to be possible but I can't find a way to access the WebFM db tables in views.

nhck’s picture

scjv please take the time to describe your problem otherwise we will not be able to help you.

scjv’s picture

Sorry for my bad english :(

I have some Drupal 5 to Drupal 6 sites and updated with all views WebFM handles is broken.
Error in views screen:
Error: handler for webfm_file > all_files doesn't exist!

Example of Views in Drupal 5 Site:

  $view = new stdClass();
  $view->name = 'webfm_lijst';
  $view->description = 'WebFM Lijst';
  $view->access = array (
  0 => '3',
  1 => '5',
);
  $view->view_args_php = '';
  $view->page = TRUE;
  $view->page_title = 'WebFM Lijst';
  $view->page_header = '';
  $view->page_header_format = '1';
  $view->page_footer = '';
  $view->page_footer_format = '1';
  $view->page_empty = '';
  $view->page_empty_format = '1';
  $view->page_type = 'table';
  $view->url = 'webfm-lijst/hoofd';
  $view->use_pager = TRUE;
  $view->nodes_per_page = '50';
  $view->menu = TRUE;
  $view->menu_title = 'WebFM lijst';
  $view->menu_tab = TRUE;
  $view->menu_tab_weight = '-10';
  $view->menu_tab_default = TRUE;
  $view->menu_tab_default_parent = NULL;
  $view->menu_tab_default_parent_type = 'normal';
  $view->menu_parent_tab_weight = '0';
  $view->menu_parent_title = '';
  $view->sort = array(
  );
  $view->argument = array(
  );
  $view->field = array(
    array(
      'tablename' => 'node',
      'field' => 'title',
      'label' => 'Title',
      'handler' => 'views_handler_field_nodelink',
      'sortable' => '1',
      'defaultsort' => 'ASC',
      'options' => 'link',
    ),
    array(
      'tablename' => 'webfm_file',
      'field' => 'fpath',
      'label' => 'Bijlaag',
      'handler' => 'webfm_views_handler_file_filename_download',
    ),
    array(
      'tablename' => 'webfm_file',
      'field' => 'ftitle',
      'label' => 'Meta title',
      'handler' => 'webfm_views_handler_file_meta_download',
    ),
    array(
      'tablename' => 'webfm_file',
      'field' => 'dl_cnt',
      'label' => 'Dl. teller',
      'sortable' => '1',
    ),
  );
  $view->filter = array(
  );
  $view->exposed_filter = array(
  );
  $view->requires = array(node, webfm_file);
  $views[$view->name] = $view;

This view generate in Drupal 6:
user warning: Unknown column 'fpath' in 'field list' query: SELECT DISTINCT node.nid AS nid, node.title AS node_title, node.language AS node_language, fpath, ftitle, dl_cnt FROM dp_node node ORDER BY node_title ASC LIMIT 0, 50 in /var/www/html/modules/views/includes/view.inc on line 771

I can create new views of type "WebFM Files" in Drupal 6 (WebFM 6.x-2.13-beta1) it works fine.

If I try to views kind of "Node" linking with WebFM, I have no WebFM group in page Add field.

nhck’s picture

Category: bug » feature
Status: Active » Postponed

Drupal 5 is not supported anymore, sorry.

As for the view you posted: I don't know how you created this?

As for the behavior of Drupal 6 you posted:
That is the way it works until someone with more knowledge/time about views comes by. Sorry.

tarzadon’s picture

I agree with mpotter in comment #19.