GithubHelp home page GithubHelp logo

silverstripe / silverstripe-widgets Goto Github PK

View Code? Open in Web Editor NEW
38.0 19.0 56.0 1.55 MB

Widgets subsystem for Silverstripe CMS

Home Page: http://silverstripe.org

License: BSD 3-Clause "New" or "Revised" License

PHP 76.30% Ruby 0.67% JavaScript 11.38% Scheme 3.84% SCSS 7.81%
hacktoberfest

silverstripe-widgets's Introduction

Widgets Module

CI Silverstripe supported module

Overview

Widgets are small pieces of functionality such as showing the latest comments or Flickr photos. They normally display on the sidebar of your website.

Installation

composer require silverstripe/widgets

Setup

Widgets are essentially database relations to other models, mostly page types. By default, they're not added to any of your own models. The easiest and most common way to get started would be to create a single collection of widgets under the name "SideBar" on your Page class. This is handled by an extension which you can enable through your config.yml:

Page:
  extensions:
    - SilverStripe\Widgets\Extensions\WidgetPageExtension

Run a dev/build, and adjust your templates to include the resulting sidebar view. The placeholder is called $SideBarView, and loops through all widgets assigned to the current page.

Alternatively, you can add one or more widget collections to your own page types. Here's an example on how to just add widgets to a MyPage type, and call it MyWidgetArea instead. Please ensure you add the correct namespaces for your module.

Installing a widget

By following the "Packaging" rules below, widgets are easily installed. This example uses the Blog module which by default has widgets already enabled.

  • Install the blog module.
  • Download the widget and unzip to the main folder of your Silverstripe website, e.g. to /widget_<widget-name>/. The folder will contain a few files, which generally won't need editing or reading.
  • Run http://my-website.com/dev/build
  • Login to the CMS and go to the 'Blog' page. Choose the "widgets" tab and click the new widget to activate it.
  • Your blog will now have the widget shown

Documentation

See the docs/en folder.

Versioning

This library follows Semver. According to Semver, you will be able to upgrade to any minor or patch version of this library without any breaking changes to the public API. Semver also requires that we clearly define the public API for this library.

Reporting Issues

Please create an issue for any bugs you've found, or features you're missing.

  • Install the Widgets Module, see above.
  • Add a WidgetArea field to your Page.
  • Add a new tab to the CMS with a WidgetAreaEditor field for managing the widgets. e.g.

mysite/code/Page.php

<?php

use SilverStripe\CMS\Model\SiteTree;
use SilverStripe\Widgets\Forms\WidgetAreaEditor;
use SilverStripe\Widgets\Model\WidgetArea;

class Page extends SiteTree
{
    // ...
    private static $has_one = array(
        'MyWidgetArea' => WidgetArea::class
    );

    public function getCMSFields()
    {
        $fields = parent::getCMSFields();
        $fields->addFieldToTab('Root.Widgets', new WidgetAreaEditor('MyWidgetArea'));
        return $fields;
    }
}

In this case, you need to alter your templates to include the $MyWidgetArea placeholder.

Writing your own widgets

To create a Widget you need at least three files - a php file containing the class, a template file of the same name and a config file called _config.php (if you dont need any config options for the widget to work then you can make it blank). Each widget should be in its own folder like widgets_widgetName/

After installing or creating a new widget, make sure to run db/build?flush=1 at the end of the URL, before attempting to use it.

The class should extend the Widget class, and must specify three config variables:

  • title: The title that will appear in the rendered widget (eg Photos). This can be customised by the CMS admin
  • cmsTitle: a more descriptive title that will appear in the cms editor (eg Flickr Photos)
  • description: a short description that will appear in the cms editor (eg This widget shows photos from Flickr). The class may also specify functions to be used in the template like a page type can.

If a Widget has configurable options, then it can specify a number of database fields to store these options in via the static $db array, and also specify a getCMSFields function that returns a FieldList, much the same way as a page type does.

An example widget is below:

FlickrWidget.php

<?php

namespace Yourname\MyWidget;

use FlickrService;
use SilverStripe\Widgets\Model\Widget;
use SilverStripe\Forms\FieldList;
use SilverStripe\Forms\TextField;
use SilverStripe\Forms\NumericField;
use SilverStripe\ORM\ArrayList;
use SilverStripe\View\ArrayData;
use SilverStripe\View\Requirements;

class FlickrWidget extends Widget
{
    private static $db = array(
        'User' => 'Varchar',
        'Photoset' => 'Varchar',
        'Tags' => 'Varchar',
        'NumberToShow' => 'Int'
    );

    private static $defaults = array(
        'NumberToShow' => 8
    );

    private static $title = 'Photos';
    private static $cmsTitle = 'Flickr Photos';
    private static $description = 'Shows flickr photos.';

    public function Photos()
    {
        // You'll need to install these yourself
        Requirements::javascript(THIRDPARTY_DIR . '/prototype/prototype.js');
        Requirements::javascript(THIRDPARTY_DIR . '/scriptaculous/effects.js');
        Requirements::javascript('mashups/javascript/lightbox.js');
        Requirements::css('mashups/css/lightbox.css');

        $flickr = new FlickrService();
        if ($this->Photoset == '') {
            $photos = $flickr->getPhotos($this->Tags, $this->User, $this->NumberToShow, 1);
        } else {
            $photos = $flickr->getPhotoSet($this->Photoset, $this->User, $this->NumberToShow, 1);
        }

        $output = new ArrayList();
        foreach ($photos->PhotoItems as $photo) {
            $output->push(
                new ArrayData(
                    array(
                        'Title' => $photo->title,
                        'Link'  => 'http://farm1.static.flickr.com/' . $photo->image_path .'.jpg',
                        'Image' => 'http://farm1.static.flickr.com/' .$photo->image_path. '_s.jpg'
                    )
                )
            );
        }
        return $output;
    }

    public function getCMSFields()
    {
        return new FieldList(
            new TextField('User', 'User'),
            new TextField('PhotoSet', 'Photo Set'),
            new TextField('Tags', 'Tags'),
            new NumericField('NumberToShow', 'Number to Show')
        );
    }
}

FlickrWidget.ss

<% control Photos %>
    <a href="$Link" rel="lightbox" title="$Title"><img src="$Image" alt="$Title" /></a>
<% end_control %>

Releasing a widget

Follow the standard procedures defined for releasing a Silverstripe module.

Here is a composer template you can use.

You need to finish off / change:

  • name (eg: yourorganisation/silverstripe-widget-carousel)
  • description
  • keywords
  • license
  • author
{
    "name": "",
    "description": "",
    "type": "silverstripe-module",
    "keywords" : [
        "widget"
    ],
    "require": {
        "silverstripe/framework": "^5.0",
        "silverstripe/cms": "^5.0"
    },
    "license": "BSD-2-Clause",
    "authors": [
        {
            "name": "",
            "email": ""
        }
    ],
    "autoload": {
        "psr-4": {
            "Yourname\\MyWidget\\": "src/"
        }
    }
}

Extending and Customizing

Rendering a $Widget Individually

To call a single Widget in a page - without adding a widget area in the CMS for you to add / delete the widgets, you can define a merge variable in the Page Controller and include it in the Page Template.

This example creates an RSSWidget with the Silverstripe blog feed.

public function SilverStripeFeed()
{
    $widget = new RSSWidget();
    $widget->RssUrl = 'http://feeds.feedburner.com/silverstripe-blog';
    return $widget->renderWith('WidgetHolder');
}

To render the widget, simply include $SilverStripeFeed in your template:

$SilverStripeFeed

As directed in the definition of SilverStripeFeed(), the Widget will be rendered through the WidgetHolder template. This is pre-defined at widgets/templates/WidgetHolder.ss and simply consists of:

<div class="WidgetHolder">
    <h3>$Title</h3>
    $Content
</div>

You can override the WidgetHolder.ss and Widget.ss templates in your theme too by adding WidgetHolder and Widget templates to themes/myThemeName/templates/Includes/

Changing the title of your widget

To change the title of your widget, you need to override the getTitle() method. By default, this simply returns the $title variable. For example, to set your widgets title to 'Hello World!', you could use:

widgets_yourWidget/src/YourWidgetWidget.php

public function getTitle()
{
    return 'Hello World!';
}

but, you can do exactly the same by setting your $title variable.

A more common reason for overriding getTitle() is to allow the title to be set in the CMS. Say you had a text field in your widget called WidgetTitle, that you wish to use as your title. If nothing is set, then you'll use your default title. This is similar to the RSS Widget in the blog module.

public function getTitle()
{
    return $this->WidgetTitle ? $this->WidgetTitle : self::$title;
}

This returns the value inputted in the CMS, if it's set or what is in the $title variable if it isn't.

Forms within Widgets

To implement a form inside a widget, you need to implement a custom controller for your widget to return this form. Make sure that your controller follows the usual naming conventions, and it will be automatically picked up by the WidgetArea rendering in your Page.ss template.

mysite/code/MyWidget.php

<?php

namespace Yourname\MyWidget;

use SilverStripe\Widgets\Model\Widget;

class MyWidget extends Widget
{
    private static $db = array(
        'TestValue' => 'Text'
    );
}
<?php

namespace Yourname\MyWidget;

use SilverStripe\Widgets\Controllers\WidgetController;
use SilverStripe\Forms\Form;
use SilverStripe\Forms\FormAction;
use SilverStripe\Forms\FieldList;
use SilverStripe\Forms\TextField;

class MyWidgetController extends WidgetController
{
    public function MyFormName()
    {
        return new Form(
            $this,
            'MyFormName',
            new FieldList(
                new TextField('TestValue')
            ),
            new FieldList(
                new FormAction('doAction')
            )
        );
    }

    public function doAction($data, $form)
    {
        // $this->widget points to the widget
    }
}

To output this form, modify your widget template.

mysite/templates/Yourname/MyWidget/MyWidget.ss

$Content
$MyFormName

Note: The necessary controller actions are only present in subclasses of PageController. To use widget forms in other controller subclasses, have a look at ContentController->handleWidget() and ContentController::$url_handlers.

But what if I have widgets on my blog currently??

Note: This applies to old versions of the blog module. The latest version of this module does not contain BlogHolder.php.

If you currently have a blog installed, the widget fields are going to double up on those pages (as the blog extends the Page class). One way to fix this is to comment out line 30 in BlogHolder.php and remove the DB entry by running a http://www.mysite.com/db/build.

blog/code/BlogHolder.php

<?php
class BlogHolder extends Page
{
    // ........
    static $has_one = array(
        // "Sidebar" => "WidgetArea", COMMENT OUT
        'Newsletter' => 'NewsletterType'
    );
    // .......
    public function getCMSFields()
    {
        $fields = parent::getCMSFields();
        $fields->removeFieldFromTab("Root.Content","Content");
        // $fields->addFieldToTab("Root.Widgets", new WidgetAreaEditor("Sidebar")); COMMENT OUT
    }
    // ...
}

Then you can use the Widget area you defined on Page.php

Translations

Translations of the natural language strings are managed through a third party translation interface, transifex.com. Newly added strings will be periodically uploaded there for translation, and any new translations will be merged back to the project source code.

Please use https://www.transifex.com/projects/p/silverstripe-widgets/ to contribute translations, rather than sending pull requests with YAML files.

See the "i18n" topic on docs.silverstripe.org for more details.

silverstripe-widgets's People

Contributors

assertchris avatar chillu avatar davebuilt avatar dependabot[bot] avatar dhensby avatar dnsl48 avatar emteknetnz avatar forsdahl avatar guysartorelli avatar halkyon avatar ivoba avatar maxime-rainville avatar mikezonnevijlle avatar nightjar avatar pine3ree avatar raissanorth avatar robbieaverill avatar ryanwachtl avatar sabina-talipova avatar scott1702 avatar shoaibali avatar ss23 avatar steiha avatar stevie-mayhew avatar tomspeak avatar torleif avatar undefinedoffset avatar vikas-srivastava avatar wernerkrauss avatar wilr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

silverstripe-widgets's Issues

widget causes page ajax to not terminate correct

SS 3.0.3:
i assigned a widgetarea to a page and have 2 widgets available.

the widgets work but i cant open the page over the sitetree in admin because the ajax call wont terminate properly: just before the last the script seems to die and the json is not valid.
the server returns a 200 however!?

when reload the page or enter the url (/admin/pages/edit/show/7) i can access the page in admin!?
and the widgets tab with the widgets is shown.

any ideas?

History widgets

There is possible include history (versions) of changes in widgets? Like some history pages....

Widgets no longer work on SS3.1

When checking out sapphire and cms 3.1-branch, widgets no longer work. When switch back to sapphire and cms 3.0-branch it works again. Error that I receive is on all widgets, for example: website.com/Widget_Controller/EditableSegment/ArchiveWidget results in 404-not-found.

Second widget on one page doesn't work

I use Silverstripe 3.0.3 stable release with the widgetmodule.
I've created several widgets wich function properly when used on a page.
But when I add several widgets to the same page the second widget fails.
I found out the functions are not being called of the second widget or that the objects not exist.

On this forum I also found this forum item:
http://www.silverstripe.org/widgets-2/show/20989
this seem to be the same problem.

Next to puting 2 widgets into one widgetarea, I also tried putting 2 widgetareas (each with one widget).
But that doesn't help.

It seems like 2 or more widgets on a page aren't possible.

Please! Make it work!!!!

WidgetHolder template seems to be clueless of loop figures

If I am not wrong the WidgetHolder.ss template is used within the WidgetArea.ss template to wrap the Widgets added to a page:
Here is the WidgetArea.ss

<% loop WidgetControllers %>
    $WidgetHolder
<% end_loop %>

and the WidgetHolder.ss:

<div class="WidgetHolder $ClassName<% if FirstLast %> $FirstLast<% end_if %>">
    <% if Title %><h3>$Title</h3><% end_if %>
    $Content
</div>

But if I add $Pos or $TotalItems to the latter the value for both position indicators is always 1 (for all Widgets added - I added 3). This came to my attention because the line

<% if FirstLast %> $FirstLast<% end_if %>

added "first last" every time (in my case for all 3 Widgets).

The documentation points out
$FirstLast: Returns a string, "first", "last", "first last" (if both), or "". Useful for CSS classes.

If it is intended like that how should the logic for
<% if FirstLast %> $FirstLast<% end_if %>
work?

Translatable support: Widget's added to homepage don't have correct Locale

Migrated from http://open.silverstripe.org/ticket/6470

Adding widgets to the homepage in one language are not recognized in the non-default language. Fix is to add this code to sapphire/widgets/Widget.php . See http://www.silverstripe.org/widgets-2/show/11375

function onBeforeWrite() {

  parent::onBeforeWrite();

  // Set locale from the currently choosen language locale 
if ($this->Locale != Translatable::get_current_locale()) $this->Locale = Translatable::get_current_locale();
}

what about 3.0?

I see this is for 3.1.. can we still get to the 3.0 branch?

Need Help to Render the Widgets in frontEnd

Widgets are not showing on my page.
I have installed the Widget Modules
Created the flickerWidget and the widget added to Default Sidebar widgetArea
flickerfleds like PhotSet,UserID is set.

page.ss
<% include SideBar %>
<div class="content-container unit size3of4 lastUnit">
<article>
<h1>$Title</h1>
<div class="content">$Content</div>
</article>
$Form
$PageComments
<% loop $WidgetArea("Sidebar") %>
$WidgetHolder
<% end_loop %>
</div>
it is not showing the Flicker widget.

ArchiveWidget is not translatable

ArchiveWidget for blog module is not translatable. Its hardcoded to "Browse by Date".
Temporary solution (as suggested by Pyromanik on irc chat) is to add to _config.php:

ArchiveWidget::$title = "Whatever 'browse by date' is in your language";

The problem (as simon_w pointed) is Widget::Title() doesn't go through _t()

Pages with widgets that have been duplicated generate notice on draft delete, breaks CMS hierarchy until browser cache flush

SS3.1.2-rc2
widgets - master branch, last commit: 2c08c17

To reproduce:
-Clean install w/ widgets module only, add generic Page extension
-Duplicate any page (not necessary to actually add any widgets)
-Delete draft (or save & publish, unpublish, delete draft)
*Notice appears, CMS SiteTree hierarchy controls disappear until browser cache flush (which often requires closing the tab or whole browser)

Maybe related to versioning?

Trace:
https://gist.github.com/clyonsEIS/1062e28c596ef6980ec0

Translations

They are sadly missing? I'm willing to start a german translation, trouble is: I have no idea how to do that. Some pointers in that direction would be appreciated.

Change $Content template variable?

WidgetHolder.ss has a $Content variable, which is the place where the Widget template is rendered. I find this to be a bit inconsistent with the use of $Content in page templates. IE you usually expect it to be a HTMLText field.

I want to propose changing this to something else, in WidgetHolder and the corresponding function in Widget.php. The only issue I can see in causing upgrade issues is in the case where someone has implemented their own WidgetHolder.ss tempate.

I've tentatively changed $Content to $Render in my local code.

Thoughts?

CMS Fields validation for widgets.

Is it possible to have validation for the fields found in the CMS for a specific widget.

I have tried the usual method for each Dataobject but it doesn't seem to be working.

public function getCMSValidator(){
}

Suggestions for improvement/potential bugs

The project we are working on, we stop working on upgrading the SS on the old site, but keen on build a new one with latest SS and then move all content from the old site. Everything works fine, but when I implement the widgets module for blog by following the instruction below:

https://github.com/silverstripe/silverstripe-blog/tree/2.0.4
https://github.com/silverstripe/silverstripe-widgets/tree/1.1

it does not work well, it shows every widget but not managable. It should be dragable, dropable and managable. And my feeling tells me maybe the JavaScript is not running. But I have no idea how to fix it.

WidgetAreaEditor failing to load custom widgetClasses

Problem was tracked down to AvailableWidgets();
Current declaration:

public function AvailableWidgets() {

    $widgets= new ArrayList();

    foreach($this->widgetClasses as $widgetClass) {
        $classes = ClassInfo::subclassesFor($widgetClass);
        array_shift($classes);
        foreach($classes as $class) {
            $widgets->push(singleton($class));
        }
    }

    return $widgets;
}

Raw fix:

public function AvailableWidgets() {

    $widgets= new ArrayList();

    foreach($this->widgetClasses as $widgetClass) {
        $classes = ClassInfo::subclassesFor($widgetClass);
        if(count($classes) > 1) array_shift($classes);    
        foreach($classes as $class) {
            $widgets->push(singleton($class));
        }
    }

    return $widgets;
}

UnsavedRelationList Error with ItemsToRender when no items to return

I get the following error when there are no widgets to return

[User Error] Uncaught LogicException: filter can't be called on an UnsavedRelationList

Trace
UnsavedRelationList->filter(Enabled,1) 
WidgetArea.php:59
WidgetArea->ItemsToRender() 
WidgetArea.php:33
WidgetArea->WidgetControllers() 
ViewableData.php:402

Using SS 3.2.3 and widgets 1.2.*@dev

New widget shown on top, then moved at bottom after page save

When you add a new widget to the widgetarea it's put on top,
but after you save the page it's shown at bottom.

Easy fix: In /widget/javascript/WidgetAreaEditor, row 135, change:

('#usedWidgets-'+$(this).attr('name')).prepend(widgetContent);

To:

('#usedWidgets-'+$(this).attr('name')).append(widgetContent);

Support lots of widgets on left hand side area editor. Scrollbar perhaps?

Original ticket: http://open.silverstripe.org/ticket/8348

When more than about 8 widgets are installed (through being on the file system), the left hand side of "available widgets" in the CMS creates a scroll bar, but you cannot drag the items to the right.

I suggest making the left and right hand side have independent scrollbars when they exceed their heights.

Secondly, if you drag the widget to any place underneath the right hand side, let it stick. Currently, you must drag it very close to an existing installed widget, which is poor usability.

Insert Widgets into Footer

Sorry im new here - how would i allow widgets in footer?

I have my widgets created ie latest blog posts and gallery which work in sidebar...but stuck on footer?

Stef

Missing Resources

Please add WidgetAreaEditor.js and WidgetAreaEditor.css into the archive as from B2 they are missing from the cms along with widget support

Personally I think its a shame widgets are now modules.

Anyway this is now the relevant function in WidgetAreaEditor.php with the js and css moved:

function FieldHolder($properties = array()) {
    Requirements::css('silverstripe-widgets/css/WidgetAreaEditor.css');
    Requirements::javascript(THIRDPARTY_DIR . "/prototype/prototype.js");
    Requirements::javascript(THIRDPARTY_DIR . '/behaviour/behaviour.js');
    Requirements::javascript('silverstripe-widgets/javascript/WidgetAreaEditor.js');

    return $this->renderWith("WidgetAreaEditor");
}

Coding conventions

The module can be improved by following the SilverStripe coding conventions more closely.

UploadField doesn't work with Widget::getCMSFields()

This is the error message:

Fatal error: Call to a member function FormAction() on a non-object in /framework/forms/FormField.php on line 139

To reproduce:

public function getCMSFields() {
    return new FieldList(
        $imageField = new UploadField('Image', 'Upload image');
    ):
}

'Not Found' error on 3.1 means Widgets cannot be added

I have tried this on an old site and a fresh install.

I have tried using widgets both the old way, and using the new

Page:
extensions:
- WidgetPageExtension

method in my main config.yml file in mysite/_config

I can’t add widgets to a page using 3.1 and widgets. They have both been installed using Composer. When I click on the [+] button the CMS attempts to access url.com/WidgetController/EditableSegment/nameofWidget but gets a 404 error.

Any widgets already on the page work as expected.

If I use composer to roll back to 3.0.x everything works as expected again.

DataObject error with Blog and Widgets modules

Alright, just did a clean install of SS 3.0.2 with the Blog (v0.6) and Widgets (v0.1) modules installed. Both modules were downloaded from the most recent master branch on GitHub. After that, if I attempt to edit a blog holder page, I get the following error while in dev mode:

Error at line 1304 of /framework/model/DataObject.php

Also, it appears that the Widgets module doesn't work at all. Not sure which module is the culprit but, either way, it's definitely a problem. :/

Doest support has_many relationship

If you have a has_many relationship, it fails to work and show a tab to select from existing data object. Even if you try to add it "manually" in getCMSFields(), it still doesnt work, throwing errors like: Fatal error: Call to a member function FormAction() on a non-object in .... framework\forms\FormField.php on line 161

Widget report

It would be neat to a have a CMS Report that tells me which widgets are used and on which pages they are used.

Widget wont render in Frontend

I have included the widgetArea on a vanilla SS3.0.* according the readme and integrated
$MyWidgetArea in Page.ss.
The widget i used is my fork of the loginwidget:
https://github.com/ivoba/silverstripe-widget-login

But the widget wont show.

If i integrated it directly with new LoginWidget() instead of WidgetArea it works.

Is this a problem of the widget or of this module?
Can you give me a hint where i can debug the rendering of $MyWidgetArea?

Widgets not clickable or draggable

Hi,

I've got the CWP basic recipe installed and have installed a few modules. I've got the widgets module installed (currently named "silverstripe-widgets"). Widgets appear but are not clickable or dragable.

Another topic suggested I rename the folder to "widgets" (and run dev/build). After doing this I go to my widget section to find that there are no longer any widgets there.

Does anybody have any suggestions?

Thanks.

Widget module not installing

Using SS 3.0.3, this module cloned today, and the blog module 0.6(the latest?).

I get the following error in CMS when try to select the blog holder page:

[User Error] Uncaught Exception: DataObject->getComponent(): Could not find component 'SideBar'.
GET /admin/pages/edit/show/6
Line 1324 in /var/www/vhosts/berzerkdev.com/berzerk/framework/model/DataObject.php
Source
1315 if($joinID) {
1316 $component = DataObject::get_one($class, ""$joinField" = $joinID");
1317 }
1318
1319 if(!isset($component) || !$component) {
1320 $component = $this->model->$class->newObject();
1321 $component->$joinField = $this->ID;
1322 }
1323 } else {
1324 throw new Exception("DataObject->getComponent(): Could not find component '$componentName'.");
1325 }
1326
1327 $this->components[$componentName] = $component;
1328 return $component;
1329 }
1330

Some thing to do with side bar?

Tests fail under silverstripe-framework 3 branch

Per the @wilr's comment in #85 the DB=MYSQL CORE_RELEASE=3 build is failing, at first I thought changing WidgetArea::ItemsToRender() to use filter() would solve the deprecation issues and allow the build to finish but it would seem that just moves to the next issue. Which is bellow, it would seem as though the silverstripe/framework 3 branch has a deprecation on has_one(). If it doesn't disappear the build log can be seen here https://travis-ci.org/webbuilders-group/silverstripe-widgets/jobs/56909007

WidgetControllerTest::testWidgetFormSubmission
DataObject->has_one is deprecated. Please use hasOne() instead. Called from WidgetContentControllerExtension->handleWidget.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.