Jump to:

10979 Posts in 2722 Topics by 1815 members

All other Modules

SilverStripe Forums » All other Modules » Gallery Module and 2.4rc1 - extraDBFields() message during /dev/build

Discuss all other Modules here.

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

Page: 1
Go to End
Author Topic: 3035 Views
  • phawley
    Avatar
    Community Member
    21 Posts

    Gallery Module and 2.4rc1 - extraDBFields() message during /dev/build Link to this post

    When I try to run a /dev/build after putting the Gallery module in an installation of 2.4rc1, I receive the following message:

    Notice: DataObjectDecorator::extraDBFields() is deprecated. Please use extraStatics() instead. in /[path_to_silverstripe]/sapphire/core/model/DataObjectDecorator.php on line 60

    and I'm taken to the admin login screen, but I can never login in as attempting to do so just brings me back to this message and login.

    I have used the Gallery module in other 2.4rc1 installs, so seems to be afoot with this in particular, and I was hoping that someone could provide some insights/hints/tips as to why this might be happening.

    Thanks in advance,
    Patrick Hawley

  • UncleCheese
    Avatar
    4085 Posts

    Re: Gallery Module and 2.4rc1 - extraDBFields() message during /dev/build Link to this post

    Try the ImageGallery module!

  • Balazs
    Avatar
    Community Member
    2 Posts

    Re: Gallery Module and 2.4rc1 - extraDBFields() message during /dev/build Link to this post

    Patrick,

    The problem is that the GalleryFile class extends the DataObjectDecorator class, and the Gallery module is not updated for Silverstripe 2.4 RC 1. The extraDBFields() method is overriden in the GalleryFile class, but unfortunately it's deprecated in 2.4 RC 1. In 2.4 RC 1 it is suggested to use the extraStatics() method instead.

    So, all you have to do is to open the GalleryFile.php file from the /code directory of the gallery module, and look after this section:

       function extraDBFields() {
          return array(
             'db' => array(
                'PopupWidth' => 'Int',
                'PopupHeight' => 'Int',
                'Embed' => 'Boolean',
                'LimitDimensions' => 'Boolean'
             )
          );
       }

    Change it to the following and you're good to go:

       function extraStatics() {
          return array(
             'db' => array(
                'PopupWidth' => 'Int',
                'PopupHeight' => 'Int',
                'Embed' => 'Boolean',
                'LimitDimensions' => 'Boolean'
             )
          );
       }

  • m-phil
    Avatar
    Community Member
    37 Posts

    Re: Gallery Module and 2.4rc1 - extraDBFields() message during /dev/build Link to this post

    There is also a small bugfix for a few mysql dbs cause of the LIMIT arg in sql querys, if the first parameter is not given

    The error says something like "ASC LIMIT ,30 | You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '30'"

    It should be LIMIT 0,30...

    Change at line 385 function CurrentGalleryItems():

    if(isset($_REQUEST['start'])) {
       $_REQUEST['start'] = (is_numeric($_REQUEST['start'])) ? $_REQUEST['start'] : 0;
    }

    To:

    if(isset($_REQUEST['start'])) {
       $_REQUEST['start'] = (is_numeric($_REQUEST['start'])) ? $_REQUEST['start'] : 0;
    } else {
       $_REQUEST['start'] = 0;
    }

  • greenpea
    Avatar
    Community Member
    19 Posts

    Re: Gallery Module and 2.4rc1 - extraDBFields() message during /dev/build Link to this post

    I get the same error [Notice: DataObjectDecorator::extraDBFields() is deprecated. Please use extraStatics() instead. in /[path_to_silverstripe]/sapphire/core/model/DataObjectDecorator.php on line 60]

    I am unsure where the GalleryFile.php file is located, can someone help me out?

  • m-phil
    Avatar
    Community Member
    37 Posts

    Re: Gallery Module and 2.4rc1 - extraDBFields() message during /dev/build Link to this post

    If you have downloaded the gallery module and copied it into your silverstripe root directory it should be in the gallery folder -> "/code/GalleryFile.php"

  • greenpea
    Avatar
    Community Member
    19 Posts

    Re: Gallery Module and 2.4rc1 - extraDBFields() message during /dev/build Link to this post

    I don't have the Galley Module, the error occurred when I upgraded my site to the new version of silverstripe.

    The only modules I have are blog, spam protection and mollom.

    I can take out the offending line from DataObjectDecorator.php, but I don't think this is the best idea. Do you have any other suggestions?

  • Sunnybex
    Avatar
    Community Member
    39 Posts

    Re: Gallery Module and 2.4rc1 - extraDBFields() message during /dev/build Link to this post

    Hi Goldie,

    I also did not have the gallery module and the same problem.

    After searching all /code-files I found the same text in the "share-shis"- module, changed it and now problem solved.
    Hope this helps evryone else

    BR

    Sunnybex

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