[Xerte] Xerte Toolkits - Project properties - Mediaandquota-can't delete files not in use

Johnathan Kemp johnathan.kemp at cxstaffs.co.uk
Tue Jun 9 14:51:03 BST 2009


Hello Pat,
 
I was not sure whether for the time being you wanted just the last
couple of characters deleting or everything to the left of  "<--- remove
this" so here are the results of both.
 
 
Deleting the 
 
\"
 
as requested solves the inclusion of an extra ".
 
Internet Explorer continues to throw its error message and deletion of
files in Firefox or IE still does not happen.
 
Deleting the whole line
 
onclick=\"javascript:delete_file('" . $dir_path . "/" . $f . "')" . "\"
\"
 
resolves the Internet Explorer error messages as well but then leaves no
function call to delete the selected file.
 
I hope this gives you the information you require :-)
 
 
In my site settings I have
 
module path = modules/
website code path = website_code/
short file area path = USER-FILES/
php library path = website_code/php/
root file path = c:\xampp\htdocs\xertetoolkits\
import path = c:\xampp\htdocs\xertetoolkits\import/
 
File uploading from within pages works and uploading a file from the
project properties / media quota section works.
 
Am I wrong in thinking that a path like the one shown in the extraction
from fiddler below is going to fail because of the mix of back and
forward slashes?
 
onclick="javascript:delete_file('C:\xampp\htdocs\xertetoolkits\USER-FILE
S/5-john.kemp-Nottingham/media/xerteTest4.flv')"

Am I getting this mix of back and forward slashes because of incorrect
settings in my site settings?

Thank you for your help with this

 
Johnathan

Johnathan Kemp
IT Dev. Manager
Connexions Staffordshire
www.cxstaffs.co.uk <http://www.cxstaffs.co.uk/> 
01785 355714


 

 

________________________________

From: xerte-bounces at lists.nottingham.ac.uk
[mailto:xerte-bounces at lists.nottingham.ac.uk] On Behalf Of Patrick
Lockley
Sent: 09 June 2009 13:35
To: Xerte discussion list
Subject: RE: [Xerte] Xerte Toolkits - Project properties -
Mediaandquota-can't delete files not in use



Website_code/php/properties/media_and_quota_template.php

 

This is near line 83 in my text editor (its in the media_folder_loop
function).

 

$result = "<div class=\"filename notfound\"
onclick=\"document.getElementById('linktext').value='" .
$xerte_toolkits_site->site_url .
str_replace($xerte_toolkits_site->root_file_path,"",$dir_path) . "/" .
$f  . "'\">" . $f . "</div><div class=\"filesize notfound\">" .
substr((filesize($full)/1000000),0,4) . " MB</div><div class=\"fileinuse
notfound notfoundtextcolor\">Not in use <img alt=\"Click to delete\"
title=\"Click to delete\"  onclick=\"javascript:delete_file('" .
$dir_path . "/" . $f . "')" . "\" \" <------ Remove this
align=\"absmiddle\" src=\"website_code/images/delete.gif\" /></div>";

 

And try again

 

Let me know if this works so I can fix it for the next patch.

 

Apologies

 

 

From: xerte-bounces at lists.nottingham.ac.uk
[mailto:xerte-bounces at lists.nottingham.ac.uk] On Behalf Of Johnathan
Kemp
Sent: 09 June 2009 13:28
To: Xerte discussion list
Subject: RE: [Xerte] Xerte Toolkits - Project properties - Media
andquota-can't delete files not in use

 

Hello Pat,

 

I have installed firebug and fiddler.

 

On opening the project properties and then selecting the Media and Quota
tab -

 

After Internet Explorer throws a box that has a blue title bar that just
says "Error" and which contains the text "A Runtime Error has occurred.
Do you wish to debug?

 

Line: 0 

Error: Expected hexadecimal digit

 

If I choose to debug and click the Yes button The visual Studio just in
time debugger box opens to offer me a choice of Microsoft Script Editor
or Visual Studio 2005

 

However at the top of this dialogue box is the text "An unhandled
exception ('Unhandled Exception') occurred in iexplore.exe [5528]"

 

I have not been able to establish what that might mean.

 

I used fiddler to extract the code that had been generated for the media
and quota page and created a html file that I ran from the xertetookits
folder.

 

The same errors occurred. When I broke the text down into individual
lines the errors were reported consistently against the line immediately
preceding the onclick event which is part of the following code block.

 

The code block below is copied from fiddler un-edited.

I could be wrong here but it looks to me that there may be two potential
issues

1.      an extra " after the closing ) in the delete_file call

2.      a mixing of back and forward slashes in the file reference

<div class="fileinuse notfound notfoundtextcolor">
Not in use 
<img alt="Click to delete" title="Click to delete"
onclick="javascript:delete_file('C:\xampp\htdocs\xertetoolkits\USER-FILE
S/5-john.kemp-Nottingham/media/xerteTest1.flv')" " align="absmiddle"
src="website_code/images/delete.gif" />
</div>

 

Changing all the slashes to back slashes and removing the extra " did
not prevent the Internet Explorer error, though changing the onclick
event to onclick="" did stop the error which suggests that the error is
something to do with the call to delete_file(). Incidentally in Firefox
removing the extra " and changing to all back slashes did cause firefox
to pause when the red x was clicked as if it was trying to do something,
but the file was not deleted (possibly because I was working with
extracted code and something else was needed to enable the process to be
completed. 

 

I don't know if this gives you any ideas what may be happening.

 

The only other thought I had regarding why firefox was not deleting the
file was if there is a file permission issue preventing the deletion.
Should I be using a htaccess file in order to make the deletion
possible? Could there be something incorrect in my apache configuration
to cause the mixing of back and forward slashes?

 

Kind regards

 

Johnathan

Johnathan Kemp
IT Dev. Manager
Connexions Staffordshire
www.cxstaffs.co.uk <http://www.cxstaffs.co.uk/> 
01785 355714

 

 

 

________________________________

From: xerte-bounces at lists.nottingham.ac.uk
[mailto:xerte-bounces at lists.nottingham.ac.uk] On Behalf Of Patrick
Lockley
Sent: 09 June 2009 10:59
To: Xerte discussion list
Subject: RE: [Xerte] Xerte Toolkits - Project properties - Media and
quota-can't delete files not in use

Hello,

 

Testing in IE8 it works here - and I get a red X displayed.

Testing in Firefox 3.0.8 it works here - and I get a red X displayed.

 

Looking at the code in
website_code/php/properties/media_and_quota_template.php - there is no
hex in there (it's all styled from CSS) - is the error you're getting
JS, PHP, or something else?

 

If you're in firefox could you install firebug? That will watch the PHP
and let you know any JS errors. In IE you could install fiddler as well.

 

Thanks

 

Pat

 

 

From: xerte-bounces at lists.nottingham.ac.uk
[mailto:xerte-bounces at lists.nottingham.ac.uk] On Behalf Of Johnathan
Kemp
Sent: 09 June 2009 10:42
To: xerte at lists.nottingham.ac.uk
Subject: [Xerte] Xerte Toolkits - Project properties - Media and quota
-can't delete files not in use

 

Hello Xerte Team,

 

I have a test Xerte on-line Toolkits set up running and am setting up a
few projects to show colleagues how to use Xerte.

 

In the Project Properties / Media and Quota section there are several
files listed as "not in use". These are .swf and .flv files that I
loaded into project pages and then as I carried on testing I edited the
pages and loaded different files, so the original ones became redundant.

 

In Firefox 3.0.5 when I click on the red X an alert box pops up asking
"Are you sure you want to delete this file?" with OK or Cancel options.

When I click on OK the alert box disappears but nothing else seems to
happen. The file I want to delete is still there, even if I completely
close down my browser windows and start afresh.

 

In Internet Explorer version 7.0.5730.11, when I open project properties
/ media and quota the quota details are displayed, save that place
markers are shown instead of the red x and an error message is displayed
"A runtime error has occurred. Do you wish to Debug? Line: 0 Error:
Expected hexadecimal digit". If I elect not to debug the first red x is
displayed and the error message is shown again, always for Line: 0. This
repeats until every red x is finally displayed. However once displayed,
whilst the tooltip shows for the red x nothing happens if you click on
them, i.e. no alert box is displayed and the file is not deleted.

 

Is this likely to be something wrong with the way I have things
configured, or is there an error in the Xerte on-line Toolkits code?

 

I am running on windows with an xampp installation.

 

Kind regards

 

Johnathan

Johnathan Kemp
IT Dev. Manager
Connexions Staffordshire
www.cxstaffs.co.uk <http://www.cxstaffs.co.uk/> 
01785 355714

 

 

________________________________

This email and any files transmitted with it are confidential and are
intended solely for the use of the individual(s) or entity(s) to whom
they are addressed. All messages are monitored for virus, high risk
files and inappropriate content. As a result users should be aware that
this mail maybe accessed, read and the right is reserved to reject,
return, remove attachments or delete if considered to be inappropriate
or unsuitable. Liability cannot be accepted for any loss or damage
arising from this email (or any attachments) or from scripts or any
virus transmitted. This communication represents the originator's
personal views and opinions, which do not necessarily reflect those of
Connexions Staffordshire. If you are not the original recipient or the
person responsible for delivering the email to the intended recipient,
be advised that you have received this email in error, and that any use,
dissemination, forwarding, printing, or copying of this email is
strictly prohibited. If you received this email in error, please
immediately reply to the sender or notify postmaster at cxstaffs.co.uk
Connexions Staffordshire Limited is registered in England No.4355170
Registered office: Foregate House, 70 Foregate Street, Stafford,
Staffordshire, ST16 2PX

________________________________

This email and any files transmitted with it are confidential and are
intended solely for the use of the individual(s) or entity(s) to whom
they are addressed. All messages are monitored for virus, high risk
files and inappropriate content. As a result users should be aware that
this mail maybe accessed, read and the right is reserved to reject,
return, remove attachments or delete if considered to be inappropriate
or unsuitable. Liability cannot be accepted for any loss or damage
arising from this email (or any attachments) or from scripts or any
virus transmitted. This communication represents the originator's
personal views and opinions, which do not necessarily reflect those of
Connexions Staffordshire. If you are not the original recipient or the
person responsible for delivering the email to the intended recipient,
be advised that you have received this email in error, and that any use,
dissemination, forwarding, printing, or copying of this email is
strictly prohibited. If you received this email in error, please
immediately reply to the sender or notify postmaster at cxstaffs.co.uk
Connexions Staffordshire Limited is registered in England No.4355170
Registered office: Foregate House, 70 Foregate Street, Stafford,
Staffordshire, ST16 2PX

This email and any files transmitted with it are confidential and are intended solely for the use of the individual(s) or entity(s) to whom they are addressed. All messages are monitored for virus, high risk files and inappropriate content. As a result users should be aware that this mail maybe accessed, read and the right is reserved to reject, return, remove attachments or delete if considered to be inappropriate or unsuitable. Liability cannot be accepted for any loss or damage arising from this email (or any attachments) or from scripts or any virus transmitted.

This communication represents the originator's personal views and opinions, which do not necessarily reflect those of Connexions Staffordshire. If you are not the original recipient or the person responsible for delivering the email to the intended recipient, be advised that you have received this email in error, and that any use, dissemination, forwarding, printing, or copying of this email is strictly prohibited. If you received this email in error, please immediately reply to the sender or notify postmaster at cxstaffs.co.uk


Connexions Staffordshire Limited is registered in England No.4355170
Registered office: Foregate House, 70 Foregate Street, Stafford, Staffordshire, ST16 2PX
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.nottingham.ac.uk/pipermail/xerte/attachments/20090609/646c495a/attachment.html


More information about the Xerte mailing list