1

I have tried every input to get it working, but nothing works for me.

This is the deprecated code

    $post = JRequest::get('post', JREQUEST_ALLOWRAW);

    list($title, $alias) = $this->_generateNewTitle($post['catid'], $post['alias'], $post['name']);
    $_POST['name']  = $title;
    $_POST['alias'] = $alias;
    $_POST['catid'] = 0;

    $this->_save();

I tried:

$post       = JFactory::getApplication()->input->get('post', '','raw');

But sadly it doesn't work.

1

You are doing a small mistake here. Have a look below:

What you tried: $post = JFactory::getApplication()->input->get('post', '','raw');

  • Here, 'post' must be the name parameter of the input field of which you want to fetch the value. Example below:

$post = JFactory::getApplication()->input->post->get('name', '','raw'); Output: will give you the value of name input field.

In your case, you want to fetch the value of the entire post data in variable $post so you should try this:

$post = JFactory::getApplication()->input->post->get('jform','','raw');

jform - I assume you are using joomla forms so by default the input field will come like jform[name], jform[catid],etc

Let us know on this

| improve this answer | |
  • I tried this: but I still get: Saving category 0 failed: Cannot save category: No name was provided! – 810 May 11 '16 at 12:31
0

This should work:

JFactory::getApplication()->input->post->get('name', '', 'RAW');
| improve this answer | |
0

i have fixed it by:

$app = JFactory::getApplication();
$post = $app->input->post->getArray();

Thnx for checking the issue.

| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.