Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8499227
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T00:36:36+00:00 2026-06-11T00:36:36+00:00

Edited code: now I’m not receiving the 404 Error but on the other hand

  • 0

Edited code: now I’m not receiving the 404 Error but on the other hand there is nothing added on the database or on exception logs.

I need to call from my model php file a postAction function on a third part module (VideoTestimonials from aheadWorks) in order to reuse all their code to get the needed functionalities and avoid future bugs if I just copied the code and modified at will.

On a previous question I was pointed on the, I guess, right direction to accomplish this goal by using setRedirect. Here is the code I’m using on my php model file to try to redirect to the postAction on the frontend:

<?php
class Dts_Videotestimonials_Model_SearchVideo extends Mage_Core_Model_Abstract
{

    function printVideoEntry($videoEntry, $_product, $tabs = "")
    {
        # get user data
        $user = Mage::getSingleton('admin/session');
        $userName = $user->getUser()->getFirstname();
        $userEmail = $user->getUser()->getEmail();
        $data = array(
            "ProductId" => $_product->getId(),
                        "AuthorEmail" => $userEmail,
                        "AuthorName" => $userName,
                        "VideoLink" => $videoEntry->getVideoWatchPageUrl(),
                        "VideoType"  => "link",
                        "Title" => $videoEntry->getVideoTitle(),
                        "Comment" => "this is a comment"
        );
        $actionUrl = Mage::getUrl('vidtest/youtube/post', $data);
        Mage::app()->getResponse()->setRedirect($actionUrl);
    }
}

All the modifications to get here where ok, step by step (with help of @Francesco) I got to this point. But when I make this call I’m receiving a 404 Error. What is wrong?

I was looking into this SO question/answer and this post on the Magento forum but can’t make my self clear. The second one is a redirect from an event Observer, I do not know exactly if it can help.

Here is the full exception log on this error:

2012-09-04T14:25:17+00:00 ERR (3): 
exception 'Zend_Controller_Response_Exception' with message 'Invalid HTTP response code' in C:\wamp\www\magento\lib\Zend\Controller\Response\Abstract.php:286
Stack trace:
#0 C:\wamp\www\magento\lib\Zend\Controller\Response\Abstract.php(150): Zend_Controller_Response_Abstract->setHttpResponseCode(Array)
#1 C:\wamp\www\magento\app\code\core\Mage\Core\Controller\Response\Http.php(106): Zend_Controller_Response_Abstract->setRedirect('http://127.0.0....', Array)
#2 C:\wamp\www\magento\app\code\local\Dts\Videotestimonials\Model\SearchVideo.php(64): Mage_Core_Controller_Response_Http->setRedirect('http://127.0.0....', Array)
#3 C:\wamp\www\magento\app\code\local\Dts\Videotestimonials\Model\SearchVideo.php(198): Dts_Videotestimonials_Model_SearchVideo->printVideoEntry(Object(Zend_Gdata_YouTube_VideoEntry), Object(Mage_Catalog_Model_Product))
#4 C:\wamp\www\magento\app\code\local\Dts\Videotestimonials\Model\SearchVideo.php(244): Dts_Videotestimonials_Model_SearchVideo->printVideoFeed(Object(Zend_Gdata_YouTube_VideoFeed), Object(Mage_Catalog_Model_Product), 'Search results ...')
#5 C:\wamp\www\magento\app\code\local\Dts\Videotestimonials\controllers\Adminhtml\VideotestimonialsbackendController.php(28): Dts_Videotestimonials_Model_SearchVideo->searchAndPrint('s')
#6 C:\wamp\www\magento\app\code\core\Mage\Core\Controller\Varien\Action.php(419): Dts_Videotestimonials_Adminhtml_VideotestimonialsbackendController->postAction()
#7 C:\wamp\www\magento\app\code\core\Mage\Core\Controller\Varien\Router\Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('post')
#8 C:\wamp\www\magento\app\code\core\Mage\Core\Controller\Varien\Front.php(176): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#9 C:\wamp\www\magento\app\code\core\Mage\Core\Model\App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#10 C:\wamp\www\magento\app\Mage.php(683): Mage_Core_Model_App->run(Array)
#11 C:\wamp\www\magento\index.php(87): Mage::run('', 'store')
#12 {main}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T00:36:38+00:00Added an answer on June 11, 2026 at 12:36 am

    you using getUrl and getBaseUrl and it’s the same thing, you can use this code:

    $this->_redirect('module/controller/action','parameters');
    

    but u have extends Mage_Adminhtml_Controller_Action on your class. its the best way. if isn’t a controller so u shouldn’t do this redirect.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have generated a group of scaffolds with edited code inside, but now I
UPDATE: Edited javascript code. It's only slightly off now in some columns. Maybe a
Is there a good way to debug exited with code 5 runtime error on
SubSonic is great and helps me code a lot faster, but now I've run
Edited Now my code is like this: #!/usr/bin/perl # import packages use Net::POP3; use
[EDIT] I changed my code according to the your answers. But now I get
Edited - I posted an earlier version of my code originally, correct code now
Edited code - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @Cell;
I downloaded and edited a code that from internet, basically what I want to
EDITED SO THE CODE IS CORRECT (THANKS TO ta.speot.is) - NEW QUESTION AT BOTTOM

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.