Since I upgraded to 2.0.7, I’ve noticed that when I upload a static resource to a sub folder (say, to my /assets folder), I’ve noticed that the path to the asset seems to get mangled in the Static Resource field.
To reproduce this:
1. I create a Static Resource
2. then I upload a file to my /assets directory, say it’s named "test.pdf".
3. The content type is PDF, binary.
4. Save
5. Preview the new Static resource
Expected: A download of the PDF is triggered.
Actual: 404 page
My logs show this:
[2011-01-20 23:59:02] (ERROR @ /index.php) Could not locate source file: /path/to/modx_doc_root/assetstest.pdf
Note that the slash is missing from the path! It should read
/path/to/modx_doc_root/assets/test.pdf
I think this is a bug with the File Browser JS validation because the static resources I created before I upgraded to 2.0.7 show the correct path in the Static Resource dropdown field (i.e. the content field in the database), e.g. "assets/test.pdf". I’ve verified this in the database too... I can fix my paths by issuing MySQL statements like this:
mysql> UPDATE modx_site_content SET content='assets/test.pdf' WHERE id=163 LIMIT 1;
Then the static resource works as expected after I update the modx_site_content.content field. I can edit and save the Static Resource pages, the path just seems to come in wrong when I select the resource using the File Browser modal window.
System Info
MODx 2.0.7-pl (traditional)
CentOS 5.5 (final)
PHP 5.3.3
MySQL 5.0.77
Other System Settings:
File Manager Path (filemanager_path): ’’
(blank)
Is File Manager Path Relative? (filemanager_path_relative): Yes
File Manager URL (filemanager_url): ’’
(blank)
Is Filie Manager URL Relative? (filemanager_url_relative): Yes