Jump to:

2011 Posts in 1436 Topics by 620 members

Form Questions

SilverStripe Forums » Form Questions » Problem with Silverstripe backend fatal error emssage

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 654 Views
  • rsilvajls
    Avatar
    Community Member
    7 Posts

    Problem with Silverstripe backend fatal error emssage Link to this post

    I got a request from a client to fix a form on the website alsm.org. Apparently they stopped receiving the form inquiries. I logged into their backend and on every page I see this error.

    Fatal error: Cannot redeclare class Form in /home/alsm_admin/alsm.org/www/sapphire/forms/Form.php on line 1289

    Anyone can help me figure out the problem?

    Thanks!

  • swaiba
    Avatar
    Forum Moderator
    1788 Posts

    Re: Problem with Silverstripe backend fatal error emssage Link to this post

    Sure! Search your code base for "class Form" then remove the duplicate class (or probably rename it to something else)

  • rsilvajls
    Avatar
    Community Member
    7 Posts

    Re: Problem with Silverstripe backend fatal error emssage Link to this post

    I did try doing that but on that line there is only a closing bracket. This is toward the end of the entire code. And this all there is.

    before that..there is only one time that class form is mentioned at the very beginning

       /**
        * Test an ajax submission of this form.
        * @return SS_HTTPResponse the response object that the handling controller produces. You can interrogate this in your unit test.
        */
       function testAjaxSubmission($action, $data) {
          $data['ajax'] = 1;
          return $this->testSubmission($action, $data);
       }
    }

    /**
    * @package forms
    * @subpackage core
    */
    class Form_FieldMap extends ViewableData {
       protected $form;
       
       function __construct($form) {
          $this->form = $form;
          parent::__construct();
       }
       
       /**
        * Ensure that all potential method calls get passed to __call(), therefore to dataFieldByName
        */
       function hasMethod($method) {
          return true;
       }

       function __call($method, $args = null) {
          return $this->form->Fields()->fieldByName($method);
       }
    }

  • swaiba
    Avatar
    Forum Moderator
    1788 Posts

    Re: Problem with Silverstripe backend fatal error emssage Link to this post

    that looks like silverstipe core code (i.e. from "sapphire" or "framework" folder) - you are looking for it within *your* code as I assume you are not hacking the core code... if you are you should strongly consider not doing so.

    maybe you had it at one time and then it was removed, in which case a dev/build should sort it out

  • rsilvajls
    Avatar
    Community Member
    7 Posts

    Re: Problem with Silverstripe backend fatal error emssage Link to this post

    Hi, yes yes its exactly a "saphire" fodler code.

    I have tried not touching anything yet. The worse part is that I am new to silverstripe and this is a site that someone else built alost 5 years ago. So I am trying to figure out what the problem is.

    What exactly do you mean by a dev/build can help me sort this out? You mean like original core code that I can use to replace this one?

  • swaiba
    Avatar
    Forum Moderator
    1788 Posts

    Re: Problem with Silverstripe backend fatal error emssage Link to this post

    Sorry if "dev/build" doesn't mean anything to you I'll have say RTM! As that is a big question that is covered by doing the most basic of things... like the tutorials... it is covered several times in this video... http://vimeo.com/16842606

  • rsilvajls
    Avatar
    Community Member
    7 Posts

    Re: Problem with Silverstripe backend fatal error emssage Link to this post

    Thank you for all of your help. I have tried replacing the code and the core files of the sapphire framework and still get the same error message. I am sure that you know how frustrating it is to work on someone elses code. I am not even sure if this is the problem with the form. The website is working just fine. One of the contact forms is my problem.

  • swaiba
    Avatar
    Forum Moderator
    1788 Posts

    Re: Problem with Silverstripe backend fatal error emssage Link to this post

    stop looking for the item in sapphire now... search the ENTIRE webroot for "class Form" it could be anywhere.

    654 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.