Quantcast
Channel: XWiki Forum - Latest topics
Viewing all articles
Browse latest Browse all 1373

Publication Workflow Application breaks local Image Links on Published pages

$
0
0

Running Publication Workflow v2.4.2 in XWiki 17.1.0

Thanks to the dev team for a useful extension! However, I’ve noticed the following subtle bug impacting image links to local attachments on child pages in the page tree that is being published:

If you configure the link with the fully qualified page identifier and attachment name, that link gets properly updated when published. The image displayed is the image file attached to the page in the published tree.

However, if you insert the image with just the attachment file name, which works fine on the draft source page then the publishing workflow prepends the link with the top page path but fails to include the child page that actually has the attached image file. Thus, the image link is broken.

Image links on one page in the tree to attachments on other pages in the tree publish just fine - because those have fully qualified paths.

E.g., on a source page in the DRAFT tree I have two images that are local attachments on that page. In the first I edited the link to be fully qualified, in the second its the ‘shorthand’ link to the local attachment that is commonly used for local attachments:

[[image:Publication Workflow Testing.DRAFT EXAMPLE.Attachments Test Top Page v1\.4.Attachments Test Child Page.WebHome@calvin-hobbes-calvin-and-hobbes-23762778-1280-800_0.jpg||alt="calvin" height="31%" width="50%"]]

[[image:Spiff's_spacecraft.png]]

When I publish to a RELEASED tree, the links have been updated to:

[[image:Publication Workflow Testing.RELEASED EXAMPLE.Attachments Test Top Page v1\.4.Attachments Test Child Page.WebHome@calvin-hobbes-calvin-and-hobbes-23762778-1280-800_0.jpg||alt="calvin" height="31%" width="50%"]]

[[image:Publication Workflow Testing.RELEASED EXAMPLE.Attachments Test Top Page v1\.4.WebHome@Spiff's_spacecraft.png]]

The 1st link is correct. The 2nd link is broken, pointing at the parent page (that is the root of the published tree) rather than the child page that contains the attachment.

Unfortunately, when using the WYSIWYG editor to upload and insert and image on a page it is inserted with the short attachment reference (even if writing in raw markup that’s the quick and easy way to do it as well). Thus, for many users who use just the WYSIWYG editor mode or enter local attachments per the XWiki docs, those local images will break when the page is published.

I suspect that handing the ‘deep copy’ of links within a published tree to translate correctly while links to wiki targets outside of the published tree was one of the more ‘interesting’ problems to solve when you implemented this extension. I guess this edge case (although perhaps not uncommon) fell through the cracks.

(PS I haven’t fully tested on and off page PDF and Office attachments)

cheers!

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 1373

Trending Articles