Problem with contact page

edited October 2012 in News & Announcements
Hello,

I have copied a working version of contact controller and view from one site on my local machine to the other.

I change the controller, view and class names to contactus.

When I try to run the contact us page I get this error:

Unable to load the requested class: fuel_page

Why do I get this in the new site and not in the other one?

It is working 100% on the other one and the only thing I changes was the names from contact to contact us.

The controller code:
class Contactus extends CI_Controller { function __construct() { parent::__construct(); } function index() { $this->load->helper('form'); if (!empty($_POST) AND $_SERVER['SERVER_ADDR'] == $_SERVER['REMOTE_ADDR']) { // put your processing code here... we show what we do for emailing. You will need to add a correct email address if ($this->_process($_POST)) { $this->session->set_flashdata('success', TRUE); redirect('contactus'); } } // use Fuel_page to render so it will grab all opt-in variables and do any necessary parsing $page_init = array('location' => 'contactus'); $this->load->module_library(FUEL_FOLDER, 'fuel_page', $page_init); $this->fuel_page->render(); } function _process($data) { if($this->input->post('nospam') != ''): return FALSE; else: $this -> load -> library( 'form_validation' ); $this -> form_validation -> set_error_delimiters('<div class="error">', '</div>'); $this -> form_validation -> set_rules( 'firstName', 'First Name', 'required|min_length[2]' ); $this -> form_validation -> set_rules( 'lastName', 'Last Name', 'required|min_length[2]' ); $this -> form_validation -> set_rules( 'email', 'Email', 'required|valid_email' ); $this -> form_validation -> set_rules( 'message', 'Message', 'required' ); if ( $this -> form_validation -> run() === TRUE ) { $this->load->library('email'); $this->load->helper('inflector'); // send email $this->email->from($data['email'], $data['firstName'] . ' ' . $data['lastName']); /********************************************************************* YOU MUST FILL OUT THE CORRECT dev_email config in application/config/MY_config.php AND/OR THE CORRECT TO email address *********************************************************************/ // check config if we are in dev mode if ($this->config->item('dev_mode')) $this->email->to($this->config->item('dev_email')); else // need to fill this out to work $this->email->to('info@test.com'); $this->email->subject('Highland Website Contact Form'); $msg = "<p>The following information was submitted:\n</p>"; foreach($data as $key => $val) { if(humanize($key, 3) != 'Send' && humanize($key, 3) != 'Nospam') $msg .= '<p>' . humanize($key, 3).": ".$val."\n</p>"; } $this->email->message($msg); // let her rip if (!$this->email->send()) { add_error('There was an error notifying'); return FALSE; } return TRUE; } endif; } }

Comments

  • edited 12:33PM
    Did you download the 1.0 beta instead?
  • edited 12:33PM
    How can I tell? The file that I downloaded is called: daylightstudio-FUEL-CMS-v0.9.3-1194-gea4de59

    Is there a way for me to check what did I download? And if I downloaded the 1.0 beta do I need to redo everything that I've done?
  • edited October 2012
    What does the FUEL_VERSION constant say in the top of the fuel/modules/fuel/config/fuel_constants.php?

    Also, how did you download the file?
  • edited 12:33PM
    0.9.3

    I fixed the problem by reinstalling fuel from a different file I've downloaded, but it looks like the last one in Git is broken?
  • edited 12:33PM
    Oh, and I downloaded it by selecting ZIP on the github. when the master branch was selected.
  • edited 12:33PM
    Do you mind downloading it again the same way to see if it's still a problem. I'm no able to replicate the problem at the moment.
  • edited 12:33PM
    Hi, I tried downlaoding it again but it does not give the file that was wrong anymore, so it tries to download the correct file which is:
    daylightstudio-FUEL-CMS-v0.9.3-168-gb3bef76.zip
    and not the one that had problems which is:
    daylightstudio-FUEL-CMS-v0.9.3-1194-gea4de59.zip

    Very strange.
Sign In or Register to comment.