Issues

ZF-11859: Zend_Dojo_Form Elements HtmlTag decorator doesn't add ID to dd

Issue Type: Bug Created: 2011-10-28T11:21:25.000+0000 Last Updated: 2011-10-28T12:13:02.000+0000 Status: Open Fix version(s): Reporter: Cristian Bichis (avantis) Assignee: Matthew Weier O'Phinney (matthew) Tags: - Zend_Dojo

Related issues: Attachments:

Description

Seems the HtmlTag decorator is not setting any id for dd.

dt has an id, but not the dd...

Below is a small sample:

<pre class="highlight">
Luna


........

Comments

Posted by Cristian Bichis (avantis) on 2011-10-28T11:46:36.000+0000

Seems others are reporting the same issue:

http://stackoverflow.com/questions/7610814/…

Posted by Cristian Bichis (avantis) on 2011-10-28T11:54:26.000+0000

Fix is to update Zend_Dojo_Form_Element_Dijit:

<pre class="highlight">
    public function loadDefaultDecorators()
    {
        if ($this->loadDefaultDecoratorsIsDisabled()) {
            return;
        }

        $decorators = $this->getDecorators();
        if (empty($decorators)) {
            $this->addDecorator('DijitElement')
                 ->addDecorator('Errors')
                 ->addDecorator('Description', array('tag' => 'p', 'class' => 'description'))
                 ->addDecorator('HtmlTag', array('tag' => 'dd'))
                 ->addDecorator('Label', array('tag' => 'dt'));
        }
    }

to

<pre class="highlight">
    public function loadDefaultDecorators()
    {
        if ($this->loadDefaultDecoratorsIsDisabled()) {
            return;
        }

        $decorators = $this->getDecorators();
        if (empty($decorators)) {
            $this->addDecorator('DijitElement')
                 ->addDecorator('Errors')
                 ->addDecorator('Description', array('tag' => 'p', 'class' => 'description'))
                 ->addDecorator('HtmlTag', array('tag' => 'dd'))
                 ->addDecorator('Label', array('tag' => 'dt', 'id'  => array('callback' => array(get_class($this), 'resolveElementId'))));
        }
    }

Posted by Cristian Bichis (avantis) on 2011-10-28T12:13:02.000+0000

I think

<pre class="highlight">
    public static function resolveElementId(Zend_Form_Decorator_Interface $decorator)
    {
        return $decorator->getElement()->getId() . '-element';
    }

should be added as well.

Have you found an issue?

See the Overview section for more details.

Copyright

© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.

Contacts