Ticket #2532268 (closed defect)

Reporter


Francesco Pongiluppi
Opened: 05/4/12
Last modified: 08/1/12
Status: closed
Type: defect
Resolution: fixed

Owner


Dav Glass
Target Release: 3.6.0
Priority: P1 (critical)
Summary: Intl.get doesn't load language modules for non-yui modules defined in a group with configFn
Description:

While upgrading from 3.4.1 to 3.5.0, this configuration stopped working.
We have external yui modules, pulled in from a private server (no combo handling) and defined as groups (as per http://yuilibrary.com/yui/docs/api/classes/config.html#property_groups). The path of
those files is defined in the configFn function.
Some of those modules need to get their language packs through Intl.get.
Those modules are YUI().use'd in html pages where their language packs are written (http://yuilibrary.com/yui/docs/intl/#packaging).
In the attached archive, you'll find an example of this html page; also, a fake module (mygroup-util-1.4), that (given the configFn), will be searched in http://my.server.it/js/util/1.4/util.js.
Note: paste this in the Firebug console and this will work:

YUI({lang: 'it'}).use("mygroup-util-1.4", function(Y) { Y.log(Y.mygroup.test()); })

Type: defect Observed in Version: 3.5.0
Component: Loader Severity: S2 (high)
Assigned To: Dav Glass Target Release: 3.6.0
Location: Library Code Priority: P1 (critical)
Tags: intl,loader,configFn Relates To: #2531451
Browsers: All
URL:
Test Information:

Attachments

Attachment #1: intl-test.zip (download)

Change History

Dav Glass

Posted: 05/7/12
  • location changed to Library Code
  • milestone changed to 3.6.0
  • priority changed to P1 (critical)
  • severity changed from S3 (normal) to S2 (high)
  • status changed from new to accepted

I worked on this all weekend and I still didn't come up with a patch so I didn't make the 3.6.0PR1 code freeze.

I was able to get the example to work, it's a hack for now but it does work.

If you set `me.lang = ['en', 'it']` in your `configFn` the modules work as expected since the lang is set before the module is fetched and not after it's fetched.

The root issue is that the lang is not there on the initial parse of the module (via the pattern) but it's there when the module is fetched. However, the old module cache still contains the old module so the lang is not attached to the module telling YUI to load the intl module. I'm still working on it, but if this hack can get you up and running I figured I would let you know so you aren't spinning your wheels waiting on my patch.

Francesco Pongiluppi

YUI Contributor

Posted: 05/8/12

Thank you so much for this:
I worked on this all weekend

I tried as you suggest in our test case, and of course it works. We're going to try it in the complete setup to see if we can hack this out waiting for your commit on the main branch. Thank you again.

Dav Glass

Posted: 05/11/12
  • completed changed from 0 to 1
  • estimated changed from 0 to 3
  • remaining changed from 0 to 2
  • sprint changed to sprint 2

Dav Glass

Posted: 06/5/12

Ticket #2529982 was marked as a duplicate of this ticket.

Dav Glass

Posted: 06/5/12
  • completed changed from 1 to 8
  • remaining changed from 2 to 0

Dav Glass

Posted: 06/5/12
  • resolution changed to fixed
  • status changed from accepted to checkedin

Refs #2532268 - Changed from merge to mix for the global module cache
View Commit: 4e13dbef84ac1fa6496a4321ccce3394c6973e33

Jenny Donnelly

YUI Developer

Posted: 08/1/12
  • status changed from checkedin to closed

Shipped in 3.6.0. Marking closed/fixed.