Hopefully this is quick and easy...
I have a TV File Type in my templates to link to a file in the files folder. But whenever click on it, the file manager opens and only allows me to browse through the images folder.
I am logged in as admin and all the permissions are fine as I can use all those other directories elsewhere... anyone else encounter this? help?
I started having the same problem after I moved a MODx installation to the production server for a client, still havn’t been able to fix the problem.
has anyone figured out whats causing this?
Ivan
Have you checked the permissions on the assets/files/ folder are set properly ?
.: COO - Commerce Guys - Community Driven Innovation :.
MODx est l'outil id
This is NOT anything to do with permissions.
The problem is that you have an image and then a file in your TVs. The file-manager call javascript output routine in the manager is stupid - it thinks "oo i’ve already outputted the load-file-manager javascript I’ll reuse that", not realising that it is set to a completely different root path.
If you have a file and then an image, it goes the other way around.
I hit the same issue so I switched to using the frontend to upload things. I’d forgotten about the issue, thanks for the reminder. I must check to see if it is fixed in 0.9.5 yet and if not file a bug report.
I stand corrected, thanks for pointing that bug out
.: COO - Commerce Guys - Community Driven Innovation :.
MODx est l'outil id
Wow thanks for pointing that out, I was beginning to think it was something I did wrong when I moved the site.
Has anyone figured out a workaround?
Workaround 1: Use QuickEdit on the frontend.
Workaround 2: Insert all your images. Then change the Sort Order of the template variables (make all the images 900 or something) so that the files have lower numbers (default is 0). Then go back and insert all your files.
--
This is still an issue in the SVN (pre-0.9.5). Can’t find it in the bug tracker so I’m adding it.
I have another workaround - but means editing the core of the MODX manager-files (actually it’s only one file: tmplvars.inc.php).
WARNING: Do this on your own risk! Remember that the file will be overwritten if you choose to update your MODX installation. Hopefully the bug will be fixed by then...
Here is what to do:
1. Open the file /manager/includes/tmplvars.inc.php
2. Go to line #147 where you will find the ’BrowseServer’ and ’SetUrl’ JavaScript functions.
3. Replace both functions with the code below:
[tt]function BrowseServer(ctrl,tp) {
lastImageCtrl = ctrl;
var w = screen.width * 0.7;
var h = screen.height * 0.7;
OpenServerBrowser(’".$base_url."manager/media/browser/mcpuk/browser.html?Type=’+tp+’&Connector=".$base_url."manager/media/browser/mcpuk/connectors/php/connector.php&ServerPath=".$base_url."’, w, h);
}
function SetUrl(url, width, height, alt){
if(!lastImageCtrl) return;
var c = document.mutate[lastImageCtrl];
if(c) c.value = url;
lastImageCtrl = ’’;
}[/tt]
4. Find the call for the ’BrowseServer’ function in line #162 and change it to:
[tt]BrowseServer(\’tv’.$field_name.’\’,\’images\’)[/tt]
5. Goto line #186 and replace the two functions again with the code above.
6. Find the call for the ’BrowseServer’ function in line #201 and change it to:
[tt]BrowseServer(\’tv’.$field_name.’\’,\’files\’)[/tt]
7. Backup the original ’tmplvars.inc.php’ file and upload the new one you’ve just edited.
8. Done
What I’ve done is to extend the JavaScript function ’BrowseServer’ to take another argument: the ’tp’-argument. The function is then called with two different arguments (’images’ and ’files’ respectively).
To me it would seem more reasonable to have all the JavaScript functions in an external .js file and then only manage the calls to these functions dynamicly in the MODX manager files. But I don’t know if there’s a specific reason to why it’s made different?
Mikkel, thanks for sharing that code.
Quote from: Mikkel at Aug 17, 2006, 04:47 PM
Do this on your own risk! Remember that the file will be overwritten if you choose to update your MODX installation. Hopefully the bug will be fixed by then...
I can confirm that garryn has incorporated a bugfix into the development trunk, and so this will be fixed in the imminent 0.9.5 release.