Error when clicking 'New Doc' in Files view

Date added: 10 February 2012 Last revised: 10 February 2012 Hits:
In DOCman 1.5.6/1.5.7, there's a bug that causes an error when clicking 'New Doc' in the backend files view. The resulting error looks something like this:
string(2) "23" array(1) { [0]=> string(12) "filename.ext" } 
This issue will be fixed in DOCman 1.5.8. In the meantime, you can solve the problem like this:
  • Open the file administrator/components/com_docman/includes/files.php
  • Find the following code:
    var_dump(__METHOD__.__LINE__, $cid );die;
    (around line 23)
  • Replace it with the following code:
    if(!$cid[0]) {
        JFactory::getApplication()
        ->redirect("index.php?option=com_docman§ion=files", 
        _DML_MAKE_SELECTION);
    }