Any ideas?
Basically I've written my first component and its working great (or so I thought)! I've imported the editor to the admin area of my components element editing view.
I can updated all the fields including the one I will call "newsletter". The data field is updated through the tinyMCE editor.
If i put any images in the img tag is completely gone by the time it gets stored to the database. I checked the following items:
1) The POST variable actually does have the tags, so tinyMCE is off the hook.
2) I've tried reading out the variables as follows and then immediately dying and the tags are getting to my model
foreach( $_POST as $key=>$val ){
$post[$key] = JRequest::getVar($key, '', 'post', 'string', JREQUEST_ALLOWRAW );
}
The only thing thats really left is either:
if(!$row->check())
or
if (!$row->store())
Any help you guys/gals can provide would be great!
SOLVED: Storing Record from Custom Component strips tags
Moderators: tjay, seadap, Rogue4ngel, matthewhayashida
SOLVED: Storing Record from Custom Component strips tags
Last edited by shahpound on Sun Feb 10, 2008 4:20 pm, edited 1 time in total.
Re: Storing Record from Custom Component strips tags
Update: Its still an issue but i also notice it is stripping out
tags and any other html as well....
tags and any other html as well....
Re: SOLVED: Storing Record from Custom Component strips tags
Hope this helps someone.
Basically when I was consuming the POST data prior to the bind I had to use this:
$data = JRequest::get( 'post',JREQUEST_ALLOWRAW)
instead of
$data = JRequest::get( 'post')
Afterwards, cycling through all the post variables and attempting to use JREQUEST_ALLOWRAW obviously wasn't working for me because the HTML had already been filtered out.
Doh!
Basically when I was consuming the POST data prior to the bind I had to use this:
$data = JRequest::get( 'post',JREQUEST_ALLOWRAW)
instead of
$data = JRequest::get( 'post')
Afterwards, cycling through all the post variables and attempting to use JREQUEST_ALLOWRAW obviously wasn't working for me because the HTML had already been filtered out.
Doh!
Re: SOLVED: Storing Record from Custom Component strips tags
$data = JRequest::get('post');
$data['text'] = JRequest::getVar( 'text', '', 'post', 'string', JREQUEST_ALLOWRAW );
This is working perfectly for me. I think you shouldn't get all the post variables with ALLOWRAW unless all the fields you are using requires HTML.
My Joomla! 1.5 extensions - http://joomla.ercan.us
Progress is made by lazy men looking for easier ways to do things.
Progress is made by lazy men looking for easier ways to do things.
Re: SOLVED: Storing Record from Custom Component strips tags
Pentacle wrote:$data = JRequest::get('post');
$data['text'] = JRequest::getVar( 'text', '', 'post', 'string', JREQUEST_ALLOWRAW );
This is working perfectly for me. I think you shouldn't get all the post variables with ALLOWRAW unless all the fields you are using requires HTML.
Understood. I was just trying to debug why my tags were being stripped out hence the for loop.