4

I'll start off by saying my plugin is working perfectly locally. The problem is when I upload to my server. My plugin is for a contact form. It handles the submission, and logs the entry in the db.

I have a page in the CP for it as well - this is the page that is giving me the white screen.

With devMode I am seeing this in the logs:

[error] [exception.Craft\HttpException.404] exception 'Craft\HttpException' in /path-to-my-site/craft/app/controllers/TemplatesController.php:59

So I looked up that file, and to me it seems that the system can't find a template?

I don't get any errors - although when I try to submit my form, I do get a 500 error. Could it be a permissions problem?

EDIT

Everything else in the entire site/app is working perfectly, so I know it's something with the plugin page.

My plugin "settings" page renders/works fine. It's when I click on the top "tab" to access my plugin's page within the CP that fails.

EDIT 2

I'm wondering if it's a case-sensitive thing now though. I don't see that exact error in the log file anymore.

I know with CodeIgniter, locally things work great, but when I upload to my server (CentOS) I get white screens. It's because of the case is all strange.

I have followed the suggested guidelines for plugin development:

controllers
    ContactFormPlugin.php
    controllers
        ContactFormController.php
            class ContactFormController extends BaseController {...}
    models
        ContactFormModel.php
            class ContactFormModel extends BaseModel{...}

   records
        ContactFormRecord.php
            class ContactFormRecord extends BaseRecord{...}
   
   resources
        ...

   services
         ContactFormService.php
             class ContactFormService extends BaseApplicationComponent {...}

   templates
       ...

   variables
       ContactFormVariable.php
           class ContactFormVariable {...}

...and so on.

My host is Rackspace, has anyone experienced this?

  • What's the stack trace of the 500 error? – Brad Bell Aug 6 '15 at 17:40
  • It's an ajax submit, so it's just javascript trace through jQuery. I have updated my question...I think it might be something else? – Damon Aug 6 '15 at 17:54
  • Could be case sensitivity. Can you share the class names as well? – Brad Bell Aug 6 '15 at 18:05
  • Hrm... that looks O.K. to me. Anything in your Apache error logs? – Brad Bell Aug 6 '15 at 19:11
3

Brad, Thank you again for your help.

I found the problem, although I'm not sure of "why". In my service file, I have this line:

$email->body = craft()->templates->renderString($settings->welcomeEmailMessage, ['firstName' => $contact->firstName]);

After digging though log file(s), I found the error. "Unexpected '['"

It needed to be this:

$email->body = craft()->templates->renderString($settings->welcomeEmailMessage, array('firstName' => $contact->firstName));

Because everything was working perfectly on my local machine, (newer version of php) I wonder if that's the root cause.

| improve this answer | |
  • 3
    Yup... the [] is PHP 5.4+ short array syntax. Your production box probably has PHP 5.3, which doesn't recognize it. – Brad Bell Aug 7 '15 at 4:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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