Item9317: JQueryPlugin's move to the body has buggered anything that relied on it being in the head

pencil
Priority: Urgent
Current State: No Action Required
Released In: n/a
Target Release: minor
Applies To: Extension
Component: ZonePlugin
Branches:
Reported By: CrawfordCurrie
Waiting For:
Last Change By: CrawfordCurrie
JQUERYPLUGIN::FOSWIKI has moved to the body zone, leaving anything that relied on it being in the head up the proverbial creek.

For example, I just tried to install UploadPlugin. The only clue I got (apart from it not working) was a JS error. View source shows the problem; even though UPLOADPLUGIN requires JQUERYPLUGIN:FOSWIKI, the dependency is silently ignored.

I'm tempted to put in an ASSERT, just so we get early warning of this case.

-- CrawfordCurrie - 13 Jul 2010

See also Item8571. This is right PITA. Scenario: plugin uses ADDTOHEAD to load a JS module which depends on JQUERYPLUGIN. But JQUERYPLUGIN is added using ADDTOZONE("body"). The failure is totally silent - you are left with a cryptic JS error.

Some possible approaches:
  1. Establish an ordering between the zones, so that something added to the body zone can be moved to the head if a dependency dictates
  2. Modify all plugins to ADDTOZONE{"body}" instead - which forces a dependency on ZonePlugin.

Affected extensions are:

-- CrawfordCurrie - 16 Jul 2010

I spoke to Michael about this once. Diverting Zones around the place based on inter-zone dependencies really will add a lot of breakable magic. Not saying we shouldn't do it, but needs careful consideration.

ZonePlugin used to have a feature where if it detected <script> tags it would divert the addToHEAD() into zone::body.

I think this would be a more acceptable solution than diverting the whole body section to head.

If you are running with {OptimizePageLayout} = 0 - the default - then this bug should not affect anyone.

Crawford, can you confirm that you are running with the default {OptimizePageLayout} = 0, because then what you describe would indeed be an urgent bug.

Then at the very least we need to add a warning to the warn log, and maybe re-introduce the ZonePlugin feature where <script> added to HEAD which depends on a BODY tag can be diverted to BODY

-- PaulHarvey - 17 Jul 2010

$Foswiki::cfg{OptimizePageLayout} = 0; is confirmed.

-- CrawfordCurrie - 18 Jul 2010

Reckon this is fixed.

-- CrawfordCurrie - 25 Jul 2010

Seems the latest checkin missed fixing ZonePlugin as well. We do need to keep both foswiki-1.1.x and ZonePlugin in sync. Reopened.

-- MichaelDaum - 25 Jul 2010

While looking for something else I stumbled on this. It may be moot; I changed release to 1.2.0 so an expert can check it.

-- CrawfordCurrie - 12 Apr 2014

ZonePlugin died ages ago. Withdrawing this.

-- Main.CrawfordCurrie - 24 Mar 2017 - 19:14
 
Topic revision: r23 - 24 Mar 2017, CrawfordCurrie
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