Jump to:

1136 Posts in 1984 Topics by 403 members

Upgrading SilverStripe

SilverStripe Forums » Upgrading SilverStripe » admin area looks strange and need always a refresh to function

Ask questions about upgrading SilverStripe to the latest version.

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

Page: 1
Go to End
Author Topic: 892 Views
  • wagnerma
    Avatar
    Community Member
    12 Posts

    admin area looks strange and need always a refresh to function Link to this post

    I upgraded from silverstripe 2.4 to 3.0.5. At the beginning, all seems to work fine, after I upgraded my site like documented. At a certain point, my site seems to crash the admin area. The site is running fine, only the admin area isn't function. When you try to edit a page of the site you get wired text out put and the admin area stops working. Pressing the reload button, all is fine, I can edit the page, pressing save, the same picture. I need to reload. I took a screen shot of the wired text look.
    Any idea?

    Thanks for your help!

    Marcel

    Attached Files
  • prwodux
    Avatar
    Community Member
    7 Posts

    Re: admin area looks strange and need always a refresh to function Link to this post

    My admin area Pages section also like this. If click on any functionality nothing happens. When I refresh the page it will display. Any solutions?

  • prwodux
    Avatar
    Community Member
    7 Posts

    Re: admin area looks strange and need always a refresh to function Link to this post

    Solved the issue.
    Remove whitespace before an opening tag, or after a closing tag, in one of the project PHP files.(mysite/code/<php files>)

  • arthurdent
    Avatar
    Community Member
    133 Posts

    Re: admin area looks strange and need always a refresh to function Link to this post

    This is EXACTLY the issue I'm trying to resolve (actually I've been trying for a couple of weeks)... I thought I was the only one having this problem!

    I'm trying to add an editable sidebar to my site. I"m using the following Page.php which validates fine. However when I load it I get the same issue as you had. I've tried to re-key to remove any extra spaces -- now it crashes out my DB rebuild at SiteTree (Gah!). Frankly it's giving me the sh*ts -- SilverStripe is a great package but I'm a designer who can code -- not a developer. Plus while I can find my way around and cut and paste code, I can't write php functions from scratch...

    So tell me -- which 'opening' and 'closing' tags are you referring to? The <?php and ?> tags? Or is it a spacing issue within?

    Must you have a space before a {?
    Do you not have a space before a (?
    Can you see any issues with the attached?

    Any advice appreciated...

    <?php
    class Page extends SiteTree {
       public static $db = array(
                          'SidebarHTML' => 'HTMLText'
                          );
       public static $has_one = array(
                             );
       function getCMSFields() {
          $fields = parent::getCMSFields();
          $fields = addFieldToTab("Root.Sidebar",new HTMLEditorField("SidebarHTML"));
          return $fields;
       }
    }
    class Page_Controller extends ContentController {
       public static $allowed_actions = array(
                                   );
       public function init(); {
          parent::init();
       }
    }

  • arthurdent
    Avatar
    Community Member
    133 Posts

    Re: admin area looks strange and need always a refresh to function Link to this post

    Well that's progress -- went through code again. Not sure shat I did -- now I simply get an "Internal Server Error'?

  • prwodux
    Avatar
    Community Member
    7 Posts

    Re: admin area looks strange and need always a refresh to function Link to this post

    Hi arthurdent
    Plaease check is there any space or new line before "<?php" or "<?" tag.
    also check is there any space or new line after "?>" tag.

  • arthurdent
    Avatar
    Community Member
    133 Posts

    Re: admin area looks strange and need always a refresh to function Link to this post

    I've been advised that SilverStripe does not need a closing tag...

    Looked at the server logs and found the error in my code (as confirmed on SS Forums) -- line 10 should be:

    $fields -> addFieldToTab("Root.Sidebar",new HTMLEditorField("SidebarHTML"));

    My bad...

    Thanks for your comments -- can see the light at the end of the tunnel now!!

  • prwodux
    Avatar
    Community Member
    7 Posts

    Re: admin area looks strange and need always a refresh to function Link to this post

    If there is a closing tag there is no white space after that. Closing tag is not a must.

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