2amigos / yiiwheels

Widget extension library for the YiiStrap extension
http://yiiwheels.2amigos.us
Other
133 stars 77 forks source link

WhRedactor Open Link in New Tab option was not submitted #116

Closed re1naldo closed 10 years ago

re1naldo commented 10 years ago

I use WhRedactor in a form. When we want to insert link to WhRedactor field, we have option to make the link open in new tab or not. If I check this option and submit the form, it seems this option was not submitted (target="blank" option in the link tag was lost). Anyone ever experienced something like this? It looks like a bug.

re1naldo commented 10 years ago

After doing more experiments, I found that target="blank" option was added to related HTML tag after we inserted link, but it was lost after the form was submitted.

tonydspaniard commented 10 years ago

@re1naldo did you find a solution for this problem?

re1naldo commented 10 years ago

No, I didn't.

tonydspaniard commented 10 years ago

Mind sharing your code so I can test it?

re1naldo commented 10 years ago

I only use WhRedactor inside TbActiveForm with simple configuration:

$form = $this->beginWidget('bootstrap.widgets.TbActiveForm',array(
    'id'=>'option-form',
    'enableClientValidation'=>true,
    'htmlOptions'=>array('enctype'=>'multipart/form-data'),
));
    echo $form->labelEx($model, 'description');
    $this->widget('yiiwheels.widgets.redactor.WhRedactor', array(
       'model'=>$model,
       'attribute'=>'description',
       'pluginOptions'=>array(
            'buttons'=>array(
                 'bold', 'italic', 'underline', 'deleted', '|', 
                 'link', 'alignment', '|', 'horizontalrule'
            ),
            'minHeight'=>200,
            'placeholder'=>'Enter the description of your option here'
      )
   ));
   echo $form->error($model, 'description', array('class'=>'error'));

   .... // the other form elements
$this->endWidget();

To see the problem, you can try inserting link to Redactor textbox (using link button) and check Open Link in New Tab option. After submitting the form, you will be able to see that target="blank" option of the link is lost (not submitted).

tonydspaniard commented 10 years ago

@re1naldo this is an issue with the redactor plugin itself not with the widget. I try to update the version.

tonydspaniard commented 10 years ago

@re1naldo I have updated the version of redactor. Mind checking on BS3 dev branch, whether it solves the issue or not? Thanks

re1naldo commented 10 years ago

@tonydspaniard Thanks for updating the redactor. I have tried it, but the buttons of redactor textfield (link, formatting, etc.) did not appear. Should I also use BS3 branch of Yiistrap? I tried the updated Yiiwheels with that branch and still got the same result.

tonydspaniard commented 10 years ago

@re1naldo The update is done on the Bootstrap 3 branch (version 2.0). Apologies. Then is an issue with the redactor itself...

re1naldo commented 10 years ago

@tonydspaniard No problem at all. I will close this issue, then. Thank you so much for your great support!