Hi,
I'm having issues getting managed files working. No matter what I do, I can't get Linkit to return any results for the the files that have been uploaded, either using the Media uploader or the default upload widget.
All the files are in the file_managed table in the db and the option for Managed files is set in the Linkit config. Node, taxonomy and user options work fine.
Testing on a fresh install with the latest devs of Linkit, Media 2, File Entity 2, Ctools, Views, Entity and WYSIWYG w/ CKEditor library.
Any idea what I could be doing wrong?
| Comment | File | Size | Author |
|---|---|---|---|
| #16 | 1554940-16-linkit-managed-file-relative-paths.patch | 1.38 KB | gooddesignusa |
| #15 | 1554940-15-linkit-managed-file.patch | 1.25 KB | anon |
| #14 | 1554940.14-linkit-managed-file.patch | 1.41 KB | mrfelton |
| #9 | override_file_access-1554940-9.patch | 809 bytes | mallezie |
Comments
Comment #1
anonFrom the info you give me, I cant say whats wrong.
Make sure you have access to the files (test with user 1).
Comment #2
chris_h commentedYep, it's with user 1, no matter what I do I can't return any results for files. Is there any other info I could provide to help debug this?
Comment #3
anonTry searching for something that will not return any files and see if you get results.
If you get results here, then its something with the file plugin.
Can you check the JSON response in Firebug or something else and see if you get any errors when files should be included in the search results?
Comment #4
chris_h commentedNo results at all, even when trying not to return any files.
No errors. I get these responses:
Example successful response for a node: Object { title="Photo", path="/node/556", group="Node"}
Example unsuccessful response (same whether there should be a file returned or not): Object { title="No results", addClass="status-notice", disabled=true}
Comment #5
anonThis means that you dont have any errors and you clearly get results back.
What you also can do is to check the watchdog log and see if you find anything.
What browser and theme are you using? Try running some default theme like garland, bartik, or seven and see if that helps.
Also, clear the cache.
Comment #6
mallezieI'm having the same problem.
Tested under Chromium and Firefox.
Tried further to debug this.
The query-object is executed, but doesn't give any result.
This is the object which returns:
Comment #7
mallezieI found out, results are given.
It's the entity_acces call which causes the results to disappear.
linkit-plugin-entity.class.php line 192
removes results. Since file_entity doesn't has a file access entity API (yet)
#1227706
Comment #8
gooddesignusa commentedI'm guessing your talking about Add a file entity access API - http://drupal.org/node/1227706
Is there a fix for this or do we have to apply the patch from http://drupal.org/node/1227706#comment-5934038
Comment #9
mallezieI am indeed referring to #1227706: Add a file entity access API.
Patch attached overrides access check for files. But could be a temporary fix.
Comment #10
chris_h commentedThis patch works as a temporary fix for me, but it links to the page (eg /file/1) rather than the file itself. Is that intended? If so, it seems strange.
Comment #11
mallezieI used media V1 and adressed this with file_create_url() (which isn't a very good solution either.
It should be solved in linkit. I think best would be to override BuildPath for the file-entity-plugin.
Comment #12
chris_h commentedNot ideal by any means, but I ended up using a mix of the temporary patch and a page manager override to redirect file/1 to the %file:url token.
Comment #13
mrfelton commentedConfirm that the patch in #9 does get it to work - can locate media at least, but as mentioned by others, the link goes to the file entity which is not the wanted behavior.
Comment #14
mrfelton commentedAttached file fixes up the path so that it links to the actual file, and not the file entity.
Comment #15
anonCommited this patch. Seems to work.
Comment #16
gooddesignusa commentedI needed relative paths for file links. I've added an option 'Link to file using relative path' inside the fieldset 'Managed files plugin settings' on the linkit profile config page. Not sure if this is the best way to do it but it works.
Comment #17
mrfelton commentedWhat we really need is to suport something more portable. Ie, a filter that works using the fid, rather than any url to the file. The Portable Path module aims to do something like this, although currently fails in my opinion. However, there is a module on Github referenced in the ticket #1647980: Use fid rather than stream wrapper. which looks promising.