Skip to content
This repository has been archived by the owner on Jul 21, 2021. It is now read-only.

Editor formatted Text #41

Open
ChuckNorrison opened this issue Apr 11, 2016 · 4 comments
Open

Editor formatted Text #41

ChuckNorrison opened this issue Apr 11, 2016 · 4 comments

Comments

@ChuckNorrison
Copy link

If Joomla Editor is used, the formatted text get stripped. There is i.e. no bold, underline or list formatting possible on reply or submit a ticket.

@ChuckNorrison
Copy link
Author

In my case i tested JCE and ARK Editor with different settings in administrator backend without a solution.

i dont understand where the format get lost..

Reply a Ticket:
"views\ticket\view.raw.php" sends already unformatted $text to reply function in "models\ticket.php" which call the OTRS. The $text was get with $jinput->get( 'otrsreplytext', null, null ). I think the value otrsreplytext was send with the javascript part from "views\ticket\tmpl\default.php" here:

$('otrsReplyForm').set('send', {
    noCache: true,
    onComplete: function(resp) {
        var obj = JSON.decode(resp);
        window.parent.closeReply(obj.error,document.forms['otrsReplyForm'].elements['formtoken'].value);
    },
    onFailure: function(resp) {
        alert("<?php echo JText::_('COM_OTRSGATEWAY_ALERT_SUBMISSION_FAILED');?>");
        window.parent.closeReply(null,document.forms['otrsReplyForm'].elements['formtoken'].value);
    }
}).send();

Some ideas?

@ChuckNorrison
Copy link
Author

Did some tests. The javascript dont strip the html code. It seems to happen with use of $jinput->get.

i have the XMLHttpRequest from above in default.php for the reply and a simple form.submit() in submit.php. It happens in both and the logs are fine.

@vittala
Copy link

vittala commented Apr 11, 2016

Hi
I suspect the tags are getting stripped by the jinput filter. With the following:

`$text = $jinput->get( 'otrsreplytext', null, null );`

The input filter is set to null so it'll default to 'cmd' (https://docs.joomla.org/Retrieving_request_data_using_JInput). Changing the third parameter to 'HTML' (or using $jinput->getHtml('otrsreplytext', null);) should allow tags to be passed through.

Regards
Vittal

@ChuckNorrison
Copy link
Author

thanks for the reply i already fixed the issue :) It was the RAW Parameter in jinput get. Now everything works with and without editor.

62d2881

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants