Item14540: PublishPlugin: Not all resources published correctly

pencil
Priority: Normal
Current State: Closed
Released In: n/a
Target Release: n/a
Applies To: Extension
Component: PublishPlugin
Branches: master
Reported By: StefanH
Waiting For:
Last Change By: BramVanOosterhout
In a recently published topic the following code is generated:
<link media="all" class="head JQUERYPLUGIN::COMMENT" type="text/css" href="../System/CommentPlugin.attachments/comment.css" rel="stylesheet"><!--JQUERYPLUGIN::COMMENT-->
<link href="../System/TwistyPlugin.attachments/twisty.css" rel="stylesheet" type="text/css" class="head JQUERYPLUGIN::TWISTY" media="all"><!--JQUERYPLUGIN::TWISTY: requires= missing ids: JavascriptFiles/foswikiPref-->
<link href="../System/SmiliesPlugin.attachments/smilies.css" rel="stylesheet" class="head SMILIESPLUGIN" type="text/css" media="all"><!--SMILIESPLUGIN-->
The file ../System/JavascriptFiles/foswikiPref.js is neither transferred to the published directory nor referenced somewhere.

-- StefanH - 24 Nov 2017

Should be OK now

-- Main.CrawfordCurrie - 26 Jan 2018 - 19:17

I'm afraid I have to reopen this. I just tested it with the latest plugin version 3.4, but foswikiPref.js is still not published.

My parameters are:
./rest /PublishPlugin/publish "topics=MyWeb.TestPage" publishskin="myskin" format="file" outfile="publish-test" allattachments="1"

-- StefanH - 02 May 2018

After further analysis it seems the corresponding line is included by our "myskin" template in this case:
%ADDTOZONE{"script" id="JavascriptFiles/foswikiPref" text="<script type=\"text/javascript\" src=\"../System/JavascriptFiles/foswikiPref.js\"></script>" requires="JQUERYPLUGIN::FOSWIKI"}%
I don't know if the PublishPlugin should handle this. If not I am fine to close this then.

-- StefanH - 02 May 2018

Tried the publication of a topic with the above ADDTOZONE. The generated html is:
<script type="text/javascript" class="script JavascriptFiles/foswikiPref" src="../System/JavascriptFiles/foswikiPref.js"></script><!--JavascriptFiles/foswikiPref-->
which is NOT the expected reference. it should be ../System/JavascriptFiles.attachments/foswikiPref.js. The file does not exists in that location or anywhere else in the published tree

Debug shows the file is treated as an external resource. And I do not copy external resources:
Processing URL ../System/JavascriptFiles/foswikiPref.js
- external resource
../System/JavascriptFiles/foswikiPref.js = ../System/JavascriptFiles/foswikiPref.js

Changing the reference to :
%ADDTOZONE{"script" id="JavascriptFiles/foswikiPref" text="<script type=\"text/javascript\" src=\"%PUBURLPATH{ "foswikiPref.js" web="System" topic="JavascriptFiles" }%\"></script>" requires="JQUERYPLUGIN::FOSWIKI"}%
helps the plugin recognise the reference as internal:
Processing URL /devwiki/pub/System/JavascriptFiles/foswikiPref.js
- matched pub_rel at System/JavascriptFiles/foswikiPref.js
Published System.JavascriptFiles:foswikiPref.js as System/JavascriptFiles.attachments/foswikiPref.js
-mapped /devwiki/pub/System/JavascriptFiles/foswikiPref.js to System/JavascriptFiles.attachments/foswikiPref.js
Rewrite System/JavascriptFiles.attachments/foswikiPref.js (rel to Sandbox/TestPublishFoswikiPrefJs.html)
as ../System/JavascriptFiles.attachments/foswikiPref.js
/devwiki/pub/System/JavascriptFiles/foswikiPref.js = ../System/JavascriptFiles.attachments/foswikiPref.js

And the file is now copied to the correct location:
$ ls publish/file/System/JavascriptFiles.attachments/
foswikiForm.js  foswikiPref.js  foswikiString.js
$

Moral of the story: PublishPlugin requires properly formed href to do its magic.

Can I close this task?

-- BramVanOosterhout - 28 Jul 2022

Hi BramVanOosterhout, thank you for this hint. I just tried it with PUBURLPATH and it works like a charm. The task can be closed.

-- StefanH - 28 Jul 2022
 
Topic revision: r7 - 31 Jul 2022, BramVanOosterhout
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy