revolution icon indicating copy to clipboard operation
revolution copied to clipboard

TV-input, @FILE bind, Could not retrieve document, error in modFileHandler

Open AntonFix opened this issue 3 years ago • 5 comments

Bug report

Summary

If i try to bind text-TV with normal txt-file i get error "Could not retrieve document".

In error logs:

[2022-06-07 15:14:12] (ERROR @ /home/***/core/vendor/xpdo/xpdo/src/xPDO/xPDO.php : 666) Could not load class: modFileHandler from modfilehandler
[2022-06-07 15:14:12] (ERROR @ /home/***/core/vendor/xpdo/xpdo/src/xPDO/xPDO.php : 1267) Problem getting service fileHandler, instance of class modFileHandler, from path 

Step to reproduce

Reproduce

Results. Result

Environment

MODX Revolution 3

AntonFix avatar Jun 07 '22 13:06 AntonFix

Did you give that a try without the leading slash in your file path?

smg6511 avatar Jun 07 '22 14:06 smg6511

Yes, both variants has same results with same error.

AntonFix avatar Jun 08 '22 10:06 AntonFix

It looks like you have to use the absolute file path to make it work. (Output the system setting [[++base_path]] (or [[++assets_path]]) and add the value to the @FILE-binding).


Unfortunately [[++base_path]] can't be directly used in the @FILE-binding. Maybe it would be a good idea to change the code, to allow placeholders like [[++assets_path]] or {assets_path}.


The modFileHandler error seems to be unrelated.

halftrainedharry avatar Jun 08 '22 14:06 halftrainedharry

@halftrainedharry - That would make sense, in that the binding can not know which media source (if any) the file is contained in. A way to overcome that would be to allow a parameter in the binding (e.g., @FILE 2 assets/folder/file.txt, where 2 is the media source id). Further, omitting the id parameter would default to the Filesystem source OR the full server path if the given file path begins with a slash).

smg6511 avatar Jun 08 '22 14:06 smg6511

Hello, Yes, the problem has been solved full server path from the root. Like this: @FILE /home/******/development/******/assets/dist/dictionaries/talenlijst.txt

AntonFix avatar Jun 08 '22 16:06 AntonFix