ZF-5929: Zend_Dojo_View_Helper_Dojo_Container::registerDijitLoader when parseOnLoad is true


Zend_Dojo generates an extra dojo.parser.parse() call which breaks dijits.

This happens when you have enabled parseOnLoad in djConfig, and use dijit based form elements.

Steps: - Enable parseOnLoad in Zend_Dojo - Add a form with dijits

Result: - The dojo view helper generates a script which runs dojo.parser.parse() in the end, which makes dojo parse the dijits in the document twice, breaking them.

Expected: - If parseOnLoad is enabled, the line running dojo.parser.parse() should never be generated.


Cleaned up the description

I have resolved patching Zend/Dojo/View/Helper/Dojo/Container.php

In line 871 add this:

        if ($this->getDjConfigOption('parseOnLoad') === false) {

            $js =<<<EOJ

function() { dojo.forEach(zendDijits, function(info) { var n = dojo.byId(; if (null != n) { dojo.attr(n, dojo.mixin({ id: }, info.params)); } }); } EOJ;


Not elegant, but it's working...

Here's the patched file.

Thank you, I thought I was doing something completely off the wall until I found this =)