Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » Just installed... already a problem

Our old forums are still available as a read-only archive.

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

Page: 1 2
Go to End
Author Topic: 33804 Views
  • Humjaba
    Avatar
    Community Member
    1 Post

    Just installed... already a problem Link to this post

    Hey all,

    So with a fresh install of Silverstripe on WinXP SP2 with Apache 2.2.4, PHP 5.2.3 and mySQL 5.0+ I get an error call to undefined index with AssetTableField.php on line 25 (or something to that affect) in the Files & Images section. I do the /db/build and no more problem. Not a big deal, but kind of worrying getting an error message on a clean install.

    Now, I try to install the gallery. I put gallery in the root folder, do a db build and flush, and create a new gallery page. I then go to Files and Images and upload some stuff into the gallery folder just created. I go to view it on my site, and they show up just fine, but there's a half page of errors above it that look like this:

    Notice: Undefined index: start in E:\Apache\htdocs\silverstripe\gallery\code\GalleryPage.php on line 381

    Notice: Undefined variable: group in E:\Apache\htdocs\silverstripe\gallery\code\GalleryPage.php on line 330

    Notice: Trying to get property of non-object in E:\Apache\htdocs\silverstripe\gallery\code\GalleryPage.php on line 330

    Notice: Undefined variable: group in E:\Apache\htdocs\silverstripe\gallery\code\GalleryPage.php on line 330

    Notice: Trying to get property of non-object in E:\Apache\htdocs\silverstripe\gallery\code\GalleryPage.php on line 330

    Notice: Undefined variable: params in E:\Apache\htdocs\silverstripe\gallery\code\GalleryPage.php on line 332

    Notice: Undefined variable: group in E:\Apache\htdocs\silverstripe\gallery\code\GalleryPage.php on line 330

    Notice: Trying to get property of non-object in E:\Apache\htdocs\silverstripe\gallery\code\GalleryPage.php on line 330

    Notice: Undefined variable: group in E:\Apache\htdocs\silverstripe\gallery\code\GalleryPage.php on line 330

    Notice: Trying to get property of non-object in E:\Apache\htdocs\silverstripe\gallery\code\GalleryPage.php on line 330

    Notice: Undefined variable: params in E:\Apache\htdocs\silverstripe\gallery\code\GalleryPage.php on line 332

    Any help? I like silverstripe more than the other CMS programs I've used but have been at it for an hour and can't get it working...

    And (last thing) when I press sort sub-pages under content I get this

    Error in Ajax evaluator on line 974: invalid flag after regular expression
    Notice: Undefined index: ID in E:\Apache\htdocs\silverstripe\cms\code\LeftAndMain.php on line 671
    Error in request

    Thanks
    -Tyler

  • arozz7
    Avatar
    Community Member
    2 Posts

    Re: Just installed... already a problem Link to this post

    I also just installed the Gallery and I am experiencing the same problem when I place the pictures in the Upload directory and point the Gallery Page there. However, if I point the Gallery Page to another directory under Assets (e.g. Gallery) the page does not load any images. In Firefox console I do not see errors though in IE 7 I get a warning on line 846, char 3, Object doesn't support this property or method. I suspect this line number pertains to the lightwindow.js file. This also occurs if there are no images in the directory. Please let me know if I am doing something wrong. I have XP SP2 with Apache 2.2.4, PHP 5.2.5 and MySql 5.0.27. Thanks in advance. The rest of the CMS is working fine.

    I fixed an undefined index error in the GalleryPage.php

    Original Code: Lines 377 - 386
       function CurrentGalleryItems() {
          /** Get the limit **/   
          $limit = "";
          if( $this->MediaPerPageLimit ) {
             if( ! is_numeric( $_REQUEST['start'] ) )
                $_REQUEST['start'] = 0;
             $limit = $_REQUEST['start'] . "," . $this->MediaPerPage;
          }
          return $this->GalleryItems( $limit );
       }
    -----------------------------------------------------
    Fixed Code: Lines 377 - 393
    function CurrentGalleryItems() {
          /** Get the limit **/   
          $limit = "";
          if( $this->MediaPerPageLimit ) {
    if (!EMPTY($_REQUEST['start'] ) ){

    if( ! is_numeric( $_REQUEST['start'] ) )
                $_REQUEST['start'] = 0;
    }
    else
    {
    $_REQUEST['start'] = 0;
    }
    $limit = $_REQUEST['start'] . "," . $this->MediaPerPage;
          }
          return $this->GalleryItems( $limit );
       }

  • arozz7
    Avatar
    Community Member
    2 Posts

    Re: Just installed... already a problem Link to this post

    I guess nobody else has experienced this problem? Is this posted in the wrong place. I can not seem to resolve this issue.

  • DesignCity
    Avatar
    38 Posts

    Re: Just installed... already a problem Link to this post

    Try to jump on icq, you may have better luck there. Sorry, I have no experience with the Windows installer/lighty so I don't think I'll be able to help

  • vokesalex
    Avatar
    Community Member
    1 Post

    Re: Just installed... already a problem Link to this post

    I had the same problems and managed to remove the errors by editing the galleryPage.php file.

    To remove the error on line 381 I followed arozz7's fix.

    The other 2 errors looked like they were variables being referenced out of scope.

    To fix error on line 330 I added

    $group = $this->Extensions();

    to the top of the function under
    function GalleryItems( $limit ) {

    To Fix error on line 332 I moved the line

    $params = array();

    from line 285 to the line underneath the line you added in the last step.

    I've attached my galleryPage.php as an attachment for ease of use.

    I'm not a php programmer, but I have working galleries using images in the galleries folder and no errors.

    Hope this helps

  • saimo
    Avatar
    Community Member
    67 Posts

    Re: Just installed... already a problem Link to this post

    I'm having the same problem...
    The fixes above removes the errors but leaves me with a blank page.

  • saimo
    Avatar
    Community Member
    67 Posts

    Re: Just installed... already a problem Link to this post

    vokesalex,

    I've got a fix which believe to be a bit cleaner. Apart from changing CurrentGalleryItems() as described earlier, I have moved the initialisation of $params and $group to the beginning of the first foreach statement, giving the the attached result.

  • Daminipo
    Avatar
    Community Member
    14 Posts

    Re: Just installed... already a problem Link to this post

    Well...
    Saimo, if i use your fixed version i get an Error and nothing works...

    I won't get that Error on line 330 where:

    if( ! $item->PopupEmbed && $group->Type != 'Documents' && $group->Type != 'WebPages' )


    is made... because $group is not an object.
    I just wonder why all the other calls on $group are working...

    I've got no idea how to get that thing running.

    and there's another thing. somewhere around line 380++ you'll find something like:

    if( ! is_numeric( $_REQUEST['start'] ) )


    and that doesn't work either. I get complains that the index "start" doesn't exists...

    Don't know how to fix that one as well...

    anyone got a helping hand?

    33804 Views
Page: 1 2
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.