Jump to content

Edit History

mrthrust

mrthrust


php versions

Hi guys... Like the title says, My module front controller produces a 404,
even though the SEO URL has been set in B.O...

I built the module on localhost (xampp) using a full copy of the production site (prestashop 1.6.0.8).. everything works great on the local setup,
install & un-install works a treat... but... as soon as I load the module on the production site the friendly URL generates the 404 error,
I've tried other development servers & had the same results, I just cant for the life of me figure out why the module produces the 404.. 

I've tried ...

  • disabling/enabling the friendly urls,
  • deleted htaccess & re-generated
  • changed module controller name, uppercase, lowercase..
  • before / after install, deleted "cache_index.php"
  • removed the record from the SEO URL table & created another with different name, 
  • cleared all browser cookies, tried other browsers.
  • enabled _PS_MODE_DEV_
  • enabled _PS_DEBUG_PROFILING_


still getting the 404 while on production

MODULE - /modules/MYCheckins/MYCheckins.php

class MYCheckins extends Module
{
    protected $config_form = false;
	
    public function __construct()
    {
        $this->name = 'MYCheckins';
        $this->tab = 'front_office_features';
        $this->version = '1.0';
        $this->author = 'MartyG';
        $this->need_instance = 1;
	$this->dbTable = 'my_checkins';
	$this->maxRows = 50;
	$this->maxImgWidth = 380;
	$this->maxImgHeight = 400;
        $this->bootstrap = true;
        parent::__construct();
        $this->displayName = $this->l('My Checkins');
        $this->description = $this->l('my checkin mapping tool.');
        $this->confirmUninstall = $this->l('Are you sure you would like to uninstall this module?');
        $this->ps_versions_compliancy = array('min' => '1.6', 'max' => '1.6.99.99');
    }
	public function install()
	{
		.. 
	}
	...
}

CONTROLLER - MYCheckins/controllers/front/checkin.php

class MYCheckinsCheckinModuleFrontController extends ModuleFrontController    
{
   // commented out, didnt seem to do anything?
   // tried with & without still the same.. 
   //public $php_self = "checkin";

   public function init() 
    {
        parent::init();
        
	// SEO META 
        $this->context->smarty->tpl_vars['meta_title']->value = Configuration::get('MYCHECKIN_META_TITLE');        
        $this->context->smarty->tpl_vars['meta_description']->value = Configuration::get('MYCHECKIN_META_DESC');
        
        // DISABLE SIDEBARS
        $this->display_column_left = false;
        $this->display_column_right = false;
    }

	public function initContent()
	{
		parent::initContent();

		...(lots of other code, checking records, getting config values)
		// load the template
		$this->setTemplate('checkin.tpl');
	}

	public function postProcess()
	{
		// check form submission
		if( Tools::isSubmit() )...
		// do validation, 
		// insert to db
		// send email
		// show template
		$this->setTemplate('complete.tpl');
	}
}

 

Like I mentioned the module works great on my local system & production... 
I can load up the module controller using the standard link
https://www.site.com/index.php?fc=module&module=MYCheckins&controller=checkin

but the url should be 
https://www.site.com/checkin

But this still generates that 404 output...

Localhost: PHP Version 5.6.21
Production: PHP Version 5.4.45 (could this cause any issues)

is there anything else I should try..?

mrthrust

mrthrust

Hi guys... Like the title says, My module front controller produces a 404,
even though the SEO URL has been set in B.O...

I built the module on localhost (xampp) using a full copy of the production site (prestashop 1.6.0.8).. everything works great on the local setup,
install & un-install works a treat... but... as soon as I load the module on the production site the friendly URL generates the 404 error,
I've tried other development servers & had the same results, I just cant for the life of me figure out why the module produces the 404.. 

I've tried ...

  • disabling/enabling the friendly urls,
  • deleted htaccess & re-generated
  • changed module controller name, uppercase, lowercase..
  • before / after install, deleted "cache_index.php"
  • removed the record from the SEO URL table & created another with different name, 
  • cleared all browser cookies, tried other browsers.
  • enabled _PS_MODE_DEV_
  • enabled _PS_DEBUG_PROFILING_


still getting the 404 while on production

MODULE - /modules/MYCheckins/MYCheckins.php

class MYCheckins extends Module
{
    protected $config_form = false;
	
    public function __construct()
    {
        $this->name = 'MYCheckins';
        $this->tab = 'front_office_features';
        $this->version = '1.0';
        $this->author = 'MartyG';
        $this->need_instance = 1;
	$this->dbTable = 'my_checkins';
	$this->maxRows = 50;
	$this->maxImgWidth = 380;
	$this->maxImgHeight = 400;
        $this->bootstrap = true;
        parent::__construct();
        $this->displayName = $this->l('My Checkins');
        $this->description = $this->l('my checkin mapping tool.');
        $this->confirmUninstall = $this->l('Are you sure you would like to uninstall this module?');
        $this->ps_versions_compliancy = array('min' => '1.6', 'max' => '1.6.99.99');
    }
	public function install()
	{
		.. 
	}
	...
}

CONTROLLER - MYCheckins/controllers/front/checkin.php

class MYCheckinsCheckinModuleFrontController extends ModuleFrontController    
{
   // commented out, didnt seem to do anything?
   // tried with & without still the same.. 
   //public $php_self = "checkin";

   public function init() 
    {
        parent::init();
        
	// SEO META 
        $this->context->smarty->tpl_vars['meta_title']->value = Configuration::get('MYCHECKIN_META_TITLE');        
        $this->context->smarty->tpl_vars['meta_description']->value = Configuration::get('MYCHECKIN_META_DESC');
        
        // DISABLE SIDEBARS
        $this->display_column_left = false;
        $this->display_column_right = false;
    }

	public function initContent()
	{
		parent::initContent();

		...(lots of other code, checking records, getting config values)
		// load the template
		$this->setTemplate('checkin.tpl');
	}

	public function postProcess()
	{
		// check form submission
		if( Tools::isSubmit() )...
		// do validation, 
		// insert to db
		// send email
		// show template
		$this->setTemplate('complete.tpl');
	}
}

 

Like I mentioned the module works great on my local system & production... 
I can load up the module controller using the standard link
https://www.site.com/index.php?fc=module&module=AMGCheckins&controller=checkin

but the url should be 
https://www.site.com/checkin

But this still generates that 404 output...

Localhost: PHP Version 5.6.21
Production: PHP Version 5.4.45 (could this cause any issues)

is there anything else I should try..?

mrthrust

mrthrust

Hi guys... Like the title says, My module front controller produces a 404,
even though the SEO URL has been set in B.O...

I built the module on localhost (xampp) using a full copy of the production site (prestashop 1.6.0.8).. everything works great on the local setup,
install & un-install works a treat... but... as soon as I load the module on the production site the friendly URL generates the 404 error,
I've tried other development servers & had the same results, I just cant for the life of me figure out why the module produces the 404.. 

I've tried ...

  • disabling/enabling the friendly urls,
  • deleted htaccess & re-generated
  • changed module controller name, uppercase, lowercase..
  • before / after install, deleted "cache_index.php"
  • removed the record from the SEO URL table & created another with different name, 
  • cleared all browser cookies, tried other browsers.
  • enabled _PS_MODE_DEV_
  • enabled _PS_DEBUG_PROFILING_


still getting the 404 while on production

MODULE - /modules/MYCheckins/MYCheckins.php

class MYCheckins extends Module
{
    protected $config_form = false;
	
    public function __construct()
    {
        $this->name = 'MYCheckins';
        $this->tab = 'front_office_features';
        $this->version = '1.0';
        $this->author = 'MartyG';
        $this->need_instance = 1;
	$this->dbTable = 'my_checkins';
	$this->maxRows = 50;
	$this->maxImgWidth = 380;
	$this->maxImgHeight = 400;
        $this->bootstrap = true;
        parent::__construct();
        $this->displayName = $this->l('My Checkins');
        $this->description = $this->l('my checkin mapping tool.');
        $this->confirmUninstall = $this->l('Are you sure you would like to uninstall this module?');
        $this->ps_versions_compliancy = array('min' => '1.6', 'max' => '1.6.99.99');
    }
	public function install()
	{
		.. 
	}
	...
}

CONTROLLER - MYCheckins/controllers/front/checkin.php

class MYCheckinsCheckinModuleFrontController extends ModuleFrontController    
{
   // commented out, didnt seem to do anything?
   // tried with & without still the same.. 
   //public $php_self = "checkin";

   public function init() 
    {
        parent::init();
        
	// SEO META 
        $this->context->smarty->tpl_vars['meta_title']->value = Configuration::get('MYCHECKIN_META_TITLE');        
        $this->context->smarty->tpl_vars['meta_description']->value = Configuration::get('MYCHECKIN_META_DESC');
        
        // DISABLE SIDEBARS
        $this->display_column_left = false;
        $this->display_column_right = false;
    }

	public function initContent()
	{
		parent::initContent();

		...(lots of other code, checking records, getting config values)
		// load the template
		$this->setTemplate('checkin.tpl');
	}

	public function postProcess()
	{
		// check form submission
		if( Tools::isSubmit() )...
		// do validation, 
		// insert to db
		// send email
		// show template
		$this->setTemplate('complete.tpl');
	}
}

 

Like I mentioned the module works great on my local system & production... 
I can load up the module controller using the standard link
https://www.site.com/index.php?fc=module&module=AMGCheckins&controller=checkin

but the url should be 
https://www.site.com/checkin

But this still generates that 404 output...

is there anything else I should try..?

×
×
  • Create New...