• Do not register here on develop.twiki.org, login with your twiki.org account.
• Use View topic Item7848 for generic doc work for TWiki-6.1.1. Use View topic Item7851 for doc work on extensions that are not part of a release. More... Close
• Anything you create or change in standard webs (Main, TWiki, Sandbox etc) will be automatically reverted on every SVN update.
Does this site look broken?. Use the LitterTray web for test cases.

Item6284: javascript not processed correctly

Item Form Data

AppliesTo: Component: Priority: CurrentState: WaitingFor: TargetRelease ReleasedIn
Extension PublishContrib Urgent New   n/a  

Edit Form Data

Summary:
Reported By:
Codebase:
Applies To:
Component:
Priority:
Current State:
Waiting For:
Target Release:
Released In:
 

Detail

We use TWiki and PublishContrib to manage our public website (see http://www.lepp.cornell.edu). We are attempting to upgrade from TWiki 4.0.5 and PublishContrib 10413 to TWiki 4.3.1 and PublishContrib 17710. However, with this upgrade, our one piece of javascript is no longer rendered properly.

On our home page, we use the following javascript to rotate through images:

<script language="Javascript">
<!--
image = new Array(4);
link = new Array(4);
image[0] = "cms.jpg";
link[0] = "./Research/EPP/CMS/";
image[1] = "control.jpg";
link[1] = "./Research/AP/CESR/";
image[2] = "ilc.jpg";
link[2] = "./Research/AP/ILC/";
image[3] = "erl.jpg";
link[3] = "./Research/AP/ERL/";
image[4] = "edu_outreach.jpg";
link[4] = "./Education/";
image[5] = "CLEO_Exp.jpg";
link[5] = "./Research/EPP/CLEO/";
index = Math.floor(Math.random() * image.length);
document.write("<p><a href='" + link[index] + "'><img border='0' src='%ATTACHURLPATH%/" + image[index] + "' width='365' height='168' /></a></p>");
//-->
</script>

After upgrading TWiki and PublishContrib, we see the following errors when trying to publish this page:

ERROR: /mnt/wiki/web/pub/LEPP/WebHome/" + image[index] + " is not readable
ERROR: MISSING RESOURCE LEPP/WebHome/" + image[index] + "

And the javascript in the published page becomes:

<script language="Javascript"> <!-- image = new Array(4); link  = new Array(4); image[0] = "cms.jpg";  link[0] = "./Research/EPP/CMS/"; image[1] = "control.jpg";  link[1] = "./Research/AP/CESR/"; image[2] = "ilc.jpg";  link[2] = "./Research/AP/ILC/"; image[3] = "erl.jpg";  link[3] = "./Research/AP/ERL/"; image[4] = "edu_outreach.jpg";  link[4] = "./Education/"; image[5] = "CLEO_Exp.jpg";  link[5] = "./Research/EPP/CLEO/"; index = Math.floor(Math.random() * image.length); document.write("<p><a href='" + link[index] + "'><img border='0' src='MISSING RESOURCE LEPP/WebHome/" + image[index] + "' width='365' height='168' /></a></p>"); //--> </script>

Any suggestions or help would be greatly appreciated.

Many thanks.

-- TWiki:Main/DevinBougie - 30 Jun 2009

The issue seems to be with the base URL for images, should be "/pub/Bugs/Item6284", but is "MISSING RESOURCE LEPP/WebHome/" in your published page. You need to read the code of the PublishContrib to understand why this happens.

As a workaround you could hardcode the "/pub/Bugs/Item6284", in your case may be "/rsrc".

Look into the PublishWebPlugin, which is actually designed for website publishing. Publishing happens transparently when saving a page, so your website is always in sync with your TWiki. See example site http://www.twiki.net - its content is entirely published out of the intranet TWiki.

-- TWiki:Main.PeterThoeny - 06 Jul 2009

Many thanks for looking into this Peter. Yes, the published page looks correct if I change the code from: src='/pub/Bugs/Item6284/" + image[index] + "' to: src='rsrc/LEPP/WebHome/" + image[index] + "'

However, now the wiki version does not render the images. Is there any chance of getting this behavior changed in the PublishContrib code (we don't see the "problem" with version 17710)?

We did look at the PublishWebPlugin when we started using TWiki to maintain our public website back in 2005, but chose to just use PublishContrib as it met our needs quite well. We actually wanted the ability to develop the website "off line" and publish a page only when it was ready (and not every time the wiki version is saved). I believe there was also some issue with our use of hierarchical webs or the desire to maintain multiple separate websites with a single TWiki installation, but that would have to be evaluated against the current PublishWebPlugin.

Thanks again!

-- TWiki:Main.DevinBougie - 08 Jul 2009

ItemTemplate
Summary javascript not processed correctly
ReportedBy TWiki:Main.DevinBougie
Codebase 4.3.1
SVN Range TWiki-5.0.0, Sat, 18 Apr 2009, build 18024
AppliesTo Extension
Component PublishContrib
Priority Urgent
CurrentState New
WaitingFor

Checkins

TargetRelease n/a
ReleasedIn

Edit | Attach | Watch | Print version | History: r3 < r2 < r1 | Backlinks | Raw View |  Raw edit | More topic actions
Topic revision: r3 - 2009-07-08 - DevinBougie
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2023 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback