Template generates wrong url's

wvd_vegt - February 16, 2009 - 11:25
Project:WebDAV for Drupal
Version:6.x-1.0-rc7
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:closed
Description

Altough I understand that the module does not function properly in non clearn url mode, there are some things that can be done to make it work a bit better.

The url's for images generated in the webdav_listing.tpl.php are wrong for instance. If they are prefixed by '$GLOBALS['base_url']. "/". ' they link correctly to the module images in both clean and non clean url mode.

Example

    <img
      src="<?php print $GLOBALS['base_url']. "/". drupal_get_path('module', 'webdav')."/images/up.png"; ?>" /></td>

The same holds for the mime type images inside the template.

My guess is that the same holds for the files as well.

#1

wvd_vegt - February 16, 2009 - 11:32

Hi,

My observation seems correct. If the template is changed a bit more the file system module works in both clean and non clean url mode.

Change (around line 70):

  <tr <?php print $count%2==0?"class='a'":""?>>
    <td><img src="<?php print $type ?>" /></td>
    <td><a href="<?php print $_item['id']?>"><?php print  $_item['name'] ?></a></td>

into:

  <tr <?php print $count%2==0?"class='a'":""?>>
    <td><img src="<?php print $type ?>" /></td>
    <td><a href="<?php print request_uri() . $_item['id']?>"><?php print  $_item['name'] ?></a></td>

and files can be access properly too. Navigating into the webdav's folders also works, navigating up still fails.

Last problem to solve is the up link.

#2

wvd_vegt - February 16, 2009 - 11:56

Hi,

If up code link is changed in webdav_listing.tpl.php like below, it nicely works in both url modes.

</tr>
    <td>
    <!--veg: 16-02-2009 Changed up link for non clean url compatibility.-->
    <?php
      $cur = request_uri();
      if ($root['name']!='') {
        $cur = str_replace($root['name']."/","",$cur);
      } else {
         $cur =$GLOBALS['base_url'];

Note, this only holds for the browser visible inside drupal!
I just tested webdav access though windows network and that one trips on non clean url's.
Windows also seems to dislike '/drupal/' in the url for now (not sure what causes it, the webdav module or windows).

#3

Yoran - April 1, 2009 - 18:14

Yep, not using clean URL is a big issue when using webdav.

About the internal browser, I'm not sure I'll keep it forever. Basicaly I less and less se the point of it. If you have any opinion I'm really interested.

#4

Yoran - May 18, 2009 - 22:28
Status:active» closed

feel free to open this again is your issue is not solved.

 
 

Drupal is a registered trademark of Dries Buytaert.