Jump to:

23368 Posts in 18143 Topics by 2863 members

General Questions

SilverStripe Forums » General Questions » Backend problem with ?ajax=1

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Page: 1
Go to End
Author Topic: 1218 Views
  • kleampa
    Avatar
    Community Member
    4 Posts

    Backend problem with ?ajax=1 Link to this post

    Hi everybody
    My problem looks like this one: http://www.silverstripe.org/general-questions/show/274833?start=0 but is different so please don't merge topics or something like this .

    Problem:
    when I try to edit some pages, I receive a javascript alert with "502 gateway problem"
    I found the ajax request ( SITE/admin/getitem?ID=XX&locale=ro_RO&ajax=1 ) and I try separate. With ?ajax=1 is same problem but wihout him is ok (the form with informations appear ok)

    With &debug_request=1 the message is:

    Debug (line 110 of RequestHandler.php): Testing '$Action//$ID/$OtherID' with 'getitem' on CMSMain

    Debug (line 116 of RequestHandler.php): Rule '$Action//$ID/$OtherID' matched to action 'handleAction' on CMSMain. Latest request params: array (
    'Action' => 'getitem',
    'ID' => NULL,
    'OtherID' => NULL,
    )

    Debug (line 136 of SSViewer.php): Selecting templates from the following list: Form, Form

    Debug (line 160 of SSViewer.php): Found template 'Form' from main template archive, containing the following items: array (
    'Includes' => '/var/www/sapphire/templates/Includes/Form.ss',
    )

    Debug (line 160 of SSViewer.php): Found template 'Form' from main template archive, containing the following items: array (
    'Includes' => '/var/www/sapphire/templates/Includes/Form.ss',
    )

    Debug (line 171 of SSViewer.php): Final template selections made: array (
    'Includes' => '/var/www/sapphire/templates/Includes/Form.ss',
    )

    Debug (line 136 of SSViewer.php): Selecting templates from the following list: TabSetFieldHolder

    Debug (line 160 of SSViewer.php): Found template 'TabSetFieldHolder' from main template archive, containing the following items: array (
    'main' => '/var/www/sapphire/templates/TabSetFieldHolder.ss',
    )

    Debug (line 171 of SSViewer.php): Final template selections made: array (
    'main' => '/var/www/sapphire/templates/TabSetFieldHolder.ss',
    )

    Debug (line 136 of SSViewer.php): Selecting templates from the following list: TabSetFieldHolder

    Debug (line 160 of SSViewer.php): Found template 'TabSetFieldHolder' from main template archive, containing the following items: array (
    'main' => '/var/www/sapphire/templates/TabSetFieldHolder.ss',
    )

    Debug (line 171 of SSViewer.php): Final template selections made: array (
    'main' => '/var/www/sapphire/templates/TabSetFieldHolder.ss',
    )

    Debug (line 136 of SSViewer.php): Selecting templates from the following list: RelationComplexTableField

    Debug (line 160 of SSViewer.php): Found template 'RelationComplexTableField' from main template archive, containing the following items: array (
    'main' => '/var/www/sapphire/templates/RelationComplexTableField.ss',
    )

    Debug (line 171 of SSViewer.php): Final template selections made: array (
    'main' => '/var/www/sapphire/templates/RelationComplexTableField.ss',
    )

    Debug (line 136 of SSViewer.php): Selecting templates from the following list: RelationComplexTableField

    Debug (line 160 of SSViewer.php): Found template 'RelationComplexTableField' from main template archive, containing the following items: array (
    'main' => '/var/www/sapphire/templates/RelationComplexTableField.ss',
    )

    Debug (line 171 of SSViewer.php): Final template selections made: array (
    'main' => '/var/www/sapphire/templates/RelationComplexTableField.ss',
    )

    Debug (line 136 of SSViewer.php): Selecting templates from the following list: TabSetFieldHolder

    Debug (line 160 of SSViewer.php): Found template 'TabSetFieldHolder' from main template archive, containing the following items: array (
    'main' => '/var/www/sapphire/templates/TabSetFieldHolder.ss',
    )

    Debug (line 171 of SSViewer.php): Final template selections made: array (
    'main' => '/var/www/sapphire/templates/TabSetFieldHolder.ss',
    )

    I'm very primitive with SilverStripe and I don't have any idea how can I debug this if with other pages works good.

    Thank you

  • kleampa
    Avatar
    Community Member
    4 Posts

    Re: Backend problem with ?ajax=1 Link to this post

    $fields = parent::getCMSFields();
          
          $fields->addFieldToTab('Root.Content.Main', new CalendarDateField('FromDate'), 'Content');
          $fields->addFieldToTab('Root.Content.Main', new CalendarDateField('ToDate'), 'Content');
          $fields->addFieldToTab('Root.Content.Main', new HTMLEditorField('Abstract'), 'Content');
          $fields->addFieldToTab('Root.Content.Main', new ImageField('Photo'));
          
          
             
          $actionTablefield = new ManyManyComplexTableField(
           $this,
           'Participants',
           'Member',
           array(
              'Surname' => 'Nume',
                'FirstName' => 'Prenume',
                'Email' => 'E-mail'
           ),
           'getMemberFormFields'
           );
             
          $actionTablefield->setAddTitle( 'Participanti' );
          $actionTablefield->setReadOnly('true');
          $actionTablefield->setDisabled('true');
          $fields->addFieldToTab( 'Root.Content.Participanti', $actionTablefield );

    somewhere here is the problem. without "Participanti" tab everything is ok

  • kleampa
    Avatar
    Community Member
    4 Posts

    Re: Backend problem with ?ajax=1 Link to this post

    Well this is the entire code:

    class Concursuri extends Page
    {
       public static $db = array(
          'Abstract'=>'HTMLVarchar(500)',
          'FromDate'=>'Date',
          'ToDate'=>'Date'
       );
       
       public static $has_one = array(
          'Photo'=>'Image'
       );

       static $many_many = array(
    'Participants'=>'Member',
        'Castigatori'=>'Member'
    );
       
       function getCMSFields() {
          $fields = parent::getCMSFields();
          
          $fields->addFieldToTab('Root.Content.Main', new CalendarDateField('FromDate'), 'Content');
          $fields->addFieldToTab('Root.Content.Main', new CalendarDateField('ToDate'), 'Content');
          $fields->addFieldToTab('Root.Content.Main', new HTMLEditorField('Abstract'), 'Content');
          $fields->addFieldToTab('Root.Content.Main', new ImageField('Photo'));
          
          $actionTablefield = new ManyManyComplexTableField(
           $this,
           'Participants',
           'Member',
           array(
              'Surname' => 'Nume',
                'FirstName' => 'Prenume',
                'Email' => 'E-mail'
           ),
           'getMemberFormFields'
           );
             
          $actionTablefield->setAddTitle( 'Participanti' );
          $actionTablefield->setReadOnly('true');
          $actionTablefield->setDisabled('true');
          $fields->addFieldToTab( 'Root.Content.Participanti', $actionTablefield );
          
          
          $actionTablefield1 = new ManyManyComplexTableField(
           $this,
           'Castigatori',
           'Member',
           array(
              'Surname' => 'Nume',
                'FirstName' => 'Prenume',
                'Email' => 'E-mail'
           ),
           'getMemberFormFields'
           );
             
          $actionTablefield1->setAddTitle( 'Castigatori' );
          $fields->addFieldToTab( 'Root.Content.Castigatori', $actionTablefield1 );
             
          return $fields;

       }
       
    }

    The problem is where I add a new tabs but I don't have any ideea how can I debug. Thanks

    1218 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.