Trying to display file set and now I am not able to
Permalink
Just upgraded to 5.5.2. and when I try to use the following in the PHP block,, I gee the following error message:
[quote]Fatal error: func_get_args(): Can't be used as a function in /home/cpctech/public_html/concrete/libaries/list_item on line 515[/quote]
And here is the code:
This worked great until we upgraded to 5.5.2.
Thanks,
Kent
[quote]Fatal error: func_get_args(): Can't be used as a function in /home/cpctech/public_html/concrete/libaries/list_item on line 515[/quote]
And here is the code:
Loader::model("file_set"); Loader::model('file_list'); $fs = FileSet::getByName('Hilltop Notes 2012'); $fl = new FileList(); $fl->filterBySet($fs); $fl->sortByFileSetDisplayOrder($gs); $files = $fl->get(); //CHANGE SORT ORDER? Comment out the next line to show the first file in set $files = array_reverse($files); //It is possible to do this by Date, Title, etc. but willl do this by set $i=0; foreach($files as $f) if ($i < 1) { $url = View::url('/download_file/view_inline', $f->getFileID(),$cID); //$url = View::url('/download_file', $f->getFileID(),$cID); //$url = 'http://docs.google.com/viewer?url=' . urlencode(BASE_URL . DIR_REL . $url);
Viewing 15 lines of 20 lines. View entire code block.
This worked great until we upgraded to 5.5.2.
Thanks,
Kent
I am having the same issue on all 4 sites i have upgraded to 5.5.2
When I go to sort the fileset I get an error. It worked great in 5.5.1
dashboard> fileset >
http://site.com/index.php/dashboard/files/sets/...
http://site.com/index.php/dashboard/files/sets/view_detail/1/...
When I go to sort the fileset I get an error. It worked great in 5.5.1
dashboard> fileset >
http://site.com/index.php/dashboard/files/sets/...
http://site.com/index.php/dashboard/files/sets/view_detail/1/...
this is the fatal error I get
Fatal error: func_get_args(): Can't be used as a function parameter in /home/cayercre/public_html/crane/concrete/libraries/item_list.php on line 515
Fatal error: func_get_args(): Can't be used as a function parameter in /home/cayercre/public_html/crane/concrete/libraries/item_list.php on line 515
And now.. My File Sets are messed up too!
What is up with that? I even went back through the upgrade script.
Grr..
Kent
What is up with that? I even went back through the upgrade script.
Grr..
Kent
OK.. Fixed the line 515 issue.. Replace with what was in 5.5.1 for line 515..
HTH,
Kent
$args = func_get_args(); for ($i = 0; $i < count($args); $i++) { $this->sortByString .= $args[$i]; if (($i + 1) < count($args)) { $this->sortByString .= ', '; } }
HTH,
Kent
This is an issue with a specific version of php, to fix it,
replace
with
replace
$this->sortByString = implode(', ', func_get_args());
with
$args = func_get_args(); $this->sortByString = implode(', ', $args);
Awesome! Works great.
Thanks.
Kent
Thanks.
Kent
Thanks... worked for me!
Worked for me too :)
Here is the solution to get the broken sortByFileSetDisplayOrder() working.
The problem is that it's looking for the fsDisplayOrder column which doesn't exist. This column can be found in the FileSetFiles table so we just need to join them in the query with this line of code:
Easiest way is to make a custom class which extends the FileList class like this:
Hope this helps :)
The problem is that it's looking for the fsDisplayOrder column which doesn't exist. This column can be found in the FileSetFiles table so we just need to join them in the query with this line of code:
->leftJoin('f', 'FileSetFiles', 'fsf', 'f.fID = fsf.fID')
Easiest way is to make a custom class which extends the FileList class like this:
class Custom_FileList extends FileList { public function createQuery() { $this->query->select('f.fID') ->from('Files', 'f') ->innerJoin('f', 'FileVersions', 'fv', 'f.fID = fv.fID and fv.fvIsApproved = 1') ->leftJoin('f', 'FileSearchIndexAttributes', 'fsi', 'f.fID = fsi.fID') ->leftJoin('f', 'FileSetFiles', 'fsf', 'f.fID = fsf.fID') ->leftJoin('f', 'Users', 'u', 'f.uID = u.uID'); } }
Hope this helps :)
$fl->sortByFileSetDisplayOrder($fs);
commenting this line out causes this to work - partly.
//$fl->sortByFileSetDisplayOrder($fs);
Thanks,
Kent