Development

Changeset 8819

You must first sign up to be able to contribute.

Changeset 8819

Show
Ignore:
Timestamp:
05/07/08 00:05:47 (1 year ago)
Author:
FabianLange
Message:

corrected ID generation for TinyMCE rich editor when no id was given. fixes #3474

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/1.0/lib/helper/sfRichTextEditorTinyMCE.class.php

    r3284 r8819  
    4242    // we need to know the id for things the rich text editor 
    4343    // in advance of building the tag 
    44     $id = _get_option($options, 'id', $this->name); 
     44    $id = _get_option($options, 'id', get_id_from_name($this->name, null)); 
    4545 
    4646    // use tinymce's gzipped js? 
     
    110110    return 
    111111      content_tag('script', javascript_cdata_section($tinymce_js), array('type' => 'text/javascript')). 
    112       content_tag('textarea', $this->content, array_merge(array('name' => $this->name, 'id' => get_id_from_name($id, null)), _convert_options($options))); 
     112      content_tag('textarea', $this->content, array_merge(array('name' => $this->name, 'id' => $id), _convert_options($options))); 
    113113  } 
    114114} 
  • branches/1.0/test/unit/helper/FormHelperTest.php

    r6069 r8819  
    9494} 
    9595 
    96 $t = new lime_test(85, new lime_output_color()); 
     96$t = new lime_test(87, new lime_output_color()); 
    9797 
    9898$context = sfContext::getInstance(); 
     
    203203$t->like(textarea_tag('name', 'content', array('rich' => 'TinyMCE')), '/tinyMCE\.init/', 'textarea_tag() can create a rich textarea tag based on tinyMCE'); 
    204204$t->like(textarea_tag('name', 'content', array('rich' => true)), '/tinyMCE\.init/', 'textarea_tag() can create a rich textarea tag based on tinyMCE'); 
     205//regression for http://trac.symfony-project.com/ticket/3474 
     206$t->like(textarea_tag('name[]', 'content', array('rich' => true)), '/elements: "name",/', 'textarea_tag() can create a rich textarea tag based on tinyMCE using correct id'); 
     207$t->like(textarea_tag('name[]', 'content', array('rich' => true, 'id' => 'test')), '/elements: "test",/', 'textarea_tag() can create a rich textarea tag based on tinyMCE using correct id'); 
    205208 
    206209class sfRichTextEditorSample extends sfRichTextEditor 

The Sensio Labs Network

Since 1998, Sensio Labs has been promoting the Open-Source software movement by providing quality web application development, training, consulting, and supporting several large Open-Source projects.