Coder Social home page Coder Social logo

sonatacorebundle's Introduction

Sonata Core Bundle

Symfony SonataCoreBundle

Latest Stable Version Latest Unstable Version License

Total Downloads Monthly Downloads Daily Downloads

Branch Travis Coveralls Scrutinizer
3.x Build Status Coverage Status Scrutinizer Status
master Build Status Coverage Status Scrutinizer Status

WARNING: This bundle is deprecated

The features provided by this bundle were moved to the following packages:

Documentation

Check out the documentation on the official website.

Support

For general support and questions, please use StackOverflow.

If you think you found a bug or you have a feature idea to propose, feel free to open an issue after looking at the contributing guide.

License

This package is available under the MIT license.

sonatacorebundle's People

Contributors

bladrak avatar caponica avatar codebach avatar core23 avatar davidromani avatar greg0ire avatar jordisala1991 avatar kal74 avatar koc avatar kunicmarko20 avatar na-ji avatar oskarstark avatar ossinkine avatar pborreli avatar phansys avatar pulzarraider avatar rande avatar romainsanchez avatar sonataci avatar soullivaneuh avatar srascar avatar sylvaindeloux avatar tgalopin avatar th3mouk avatar tifabien avatar tim96 avatar toooni avatar wbloszyk avatar wharenn avatar wouterj 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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sonatacorebundle's Issues

Issue in ResizeFormListener when persisting images with SonataMediaBundle

I'm using SonataMediaBundle to store multiple images in an entity called Restaurant. I've also created a RestaurantHasMedia for the OneToMany relation and the related Admin classes. The issue happens when I add an image and the save the entity or I try to add a second image to the Restaurant entity from the SonataAdmin. This is what I get:

Error: Cannot use object of type AppBundle\Entity\RestaurantHasMedia as array
in vendor/sonata-project/core-bundle/Form/EventListener/ResizeFormListener.php at line 166 -
$form->add($name, $this->type, $options);
}
if (isset($value['_delete'])) {
$this->removed[] = $name;
}
}

Debugging it I've seen that $value comes as a AppBundle\Entity\RestaurantHasMedia object so I've fixed it adding an is_array check:

            if (is_array($value) && isset($value['_delete'])) {
                $this->removed[] = $name;
            }

Now it works but I'm thinking that the problem may be in my code and not in SonataCoreBundle. Even though I wanted to share just in case I found a bug. After lots of days trying to have multiple images in an entity using SonataMediaBundle this has been the only "successful" code for me.

This is how my code more or less looks like (edited other entity properties for simplicity):

/**
 * @ORM\Entity
 * @ORM\Table(name="restaurants")
 */
class Restaurant
{
    ...
    /**
     * @ORM\OneToMany(targetEntity="AppBundle\Entity\RestaurantHasMedia", mappedBy="restaurantMedias", cascade={"persist","remove"}, fetch="LAZY")
     */
    protected $images;
}
/**
 * @ORM\Entity
 * @ORM\Table(name="restaurant_media")
 */
class RestaurantHasMedia
{
    /**
     * @ORM\Id
     * @ORM\Column(type="integer")
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    protected $id;

    /**
     * @var \Application\Sonata\MediaBundle\Entity\Media
     * @Assert\NotBlank()
     * @ORM\ManyToOne(targetEntity="Application\Sonata\MediaBundle\Entity\Media", cascade={"persist"}, fetch="LAZY")
     * @ORM\JoinColumn(name="media_id", referencedColumnName="id")
     */
    protected $media;

    /**
     * @var \AppBundle\Entity\Restaurant
     * @Assert\NotBlank()
     * @ORM\ManyToOne(targetEntity="\AppBundle\Entity\Restaurant", cascade={"persist","remove"}, inversedBy="images", fetch="LAZY")
     * @ORM\JoinColumn(name="restaurant_id", referencedColumnName="id", nullable=true)
     */
    protected $restaurantMedias;
    ...
}

And this are the Admin classes:

class RestaurantAdmin extends Admin
{
    protected function configureFormFields(FormMapper $formMapper)
    {
        $this->setTemplate('edit', 'SonataAdminBundle:CRUD:edit.html.twig');

        /** @var $restaurant \AppBundle\Entity\Restaurant */
        $restaurant = $this->getSubject();

        $formMapper
            ->with('Media')
                ->add(
                    'images',
                    'sonata_type_collection',
                    array(
                        'cascade_validation' => false,
                        'type_options' => array('delete' => false),
                    ),
                    array(
                        'edit' => 'inline',
                        'inline' => 'table',
                        'sortable' => 'position',
                        'link_parameters' => array('context' => 'default'),
                        'admin_code' => 'sonata.admin.restaurant_has_media',
                    )
                )
            ->end()
        ;
    }

    public function prePersist($restaurant)
    {
        $this->updateImages($restaurant);
    }

    public function preUpdate($restaurant)
    {
        $this->updateImages($restaurant);
    }

    private function updateImages(&$restaurant)
    {
        foreach ($restaurant->getImages() as $image) {
            $image->setRestaurantMedias($restaurant);
        }
    }
}
class RestaurantHasMediaAdmin extends Admin
{
    protected function configureFormFields(FormMapper $formMapper)
    {
        $formMapper->add(
            'media',
            'sonata_type_model_list',
            array(
                'required' => false
            ),
            array(
                'link_parameters' => array(
                    'context'  => 'restaurants',
                    'provider' => 'sonata.media.provider.image',
                ),
            )
        );
    }
}

services.yml:

    sonata.admin.restaurant:
        class: AppBundle\Admin\RestaurantAdmin
        tags:
            - { name: sonata.admin, manager_type: orm, group: "Content", label: "Restaurant" }
        arguments:
            - ~
            - AppBundle\Entity\Restaurant
            - ~
        calls:
            - [ setTranslationDomain, [AppBundle]]

    sonata.admin.restaurant_has_media:
        class: AppBundle\Admin\RestaurantHasMediaAdmin
        tags:
            - { name: sonata.admin, manager_type: orm, group: "Content", label: "RestaurantHasMedia" }
        arguments:
            - ~
            - AppBundle\Entity\RestaurantHasMedia
            - ~
        calls:
            - [ setTranslationDomain, [AppBundle]]

Implement API pagination through PageableManagerInterface

UserBundle

PageBundle

ClassificationBundle

E-commerce

NewsBundle

Add datepicker calender week option

The upcoming version of the https://github.com/Eonasdan/bootstrap-datetimepicker
will feature the calendar week option:
Eonasdan/tempus-dominus#130
Eonasdan/tempus-dominus#478

This could then be added to the dp_ options:
https://github.com/sonata-project/SonataCoreBundle/blob/master/Form/Type/BasePickerType.php#l80-104

Based on:
http://eonasdan.github.io/bootstrap-datetimepicker/

I guess the default should be set to false.

I will return to this issue as soon the the option has been released.

Who contributes to the datepicker in this CoreBundle?

[Feature request] CSV export options

Situation

Currently the Sonata\CoreBundle\Exporter\Exporter does not have any options for the column delimiter or the enclosing character if $format = csv is used.
Instead its using the following hardcoded:

$writer = new CsvWriter('php://output', ',', '"', "", true, true);

Use Case

Theoretically the file is a correct CSV-File using comma as seperator but
opening a CSV-File generated by this exporter under Windows with Mircosoft Excel can cause that Excel does not manage to separate the columns correctly (depends on the OS system configurations and/or the Excel version and its configuration)

Prospect

The exporter should have another param for the getResponse method which could be called $formatOptions. That could be an array of options for the selected export format. That would imply that the SonataAdminBundle needs to be adjusted as well and provide the configured values for the exported format.

It seems that CSV is the only export format that needs to be configureable at the moment. This makes it quite difficult for me to suggest where the best place would be to set up the options for the CSV export.

Admin class ?
config.yml ?
both ?

datetimepicker not working

after assets:install there is no folder named public wich sposed to contain js and css for the datetimepicker , even when i add all resorces manualy its not working :/

Update eonasdan-bootstrap-datetimepicker to current version 4.0

As mentioned by @afurculita in issue #115 (comment) version 4.0 of the eonasdan-bootstrap-datetimepicker has been released:

This version includes new features like the calendarWeek options:

But they also mention some BC:

Can someone tell if these BC are relevant to the SonataCoreBundle ?

If not I could create the PR for the bower.json file:
https://github.com/sonata-project/SonataCoreBundle/blob/master/bower.json#L8

Changing dependencies from "eonasdan-bootstrap-datetimepicker": "3.1.3" to "eonasdan-bootstrap-datetimepicker": "4.0.0".

Not sure if the version by @Bladrak is a better solution linking the latest version:

Then I would create a PR on the docs for the new options.

Crash since last update

Hello.

Since last update, I've this error :

ContextErrorException: Catchable Fatal Error: Argument 2 passed to Sonata\CoreBundle\FlashMessage\FlashManager::__construct() must implement interface Symfony\Component\Translation\TranslatorInterface, array given, called in /var/www/beta.harmony-hosting.com/app/cache/dev/appDevDebugProjectContainer.php on line 4814 and defined in /var/www/beta.harmony-hosting.com/vendor/sonata-project/core-bundle/Sonata/CoreBundle/FlashMessage/FlashManager.php line 53

Here's my Composer.json file :

{
    "name": "symfony/framework-standard-edition",
    "license": "MIT",
    "type": "project",
    "description": "The \"Symfony Standard Edition\" distribution",
    "autoload": {
        "psr-0": { "": "src/" }
    },
    "require": {
        "php": ">=5.3.3",
        "symfony/symfony": "2.3.*",
        "doctrine/orm": ">=2.2.3,<2.4-dev",
        "doctrine/doctrine-bundle": "1.2.*",
        "twig/extensions": "1.0.*",
        "symfony/assetic-bundle": "2.3.*",
        "symfony/swiftmailer-bundle": "2.3.*",
        "symfony/monolog-bundle": "2.3.*",
        "sensio/distribution-bundle": "2.3.*",
        "sensio/framework-extra-bundle": "2.3.*",
        "sensio/generator-bundle": "2.3.*",
        "incenteev/composer-parameter-handler": "~2.0",

        "jquery/jquery": "2.0.3",
        "mopa/bootstrap-bundle": "dev-master",
        "twbs/bootstrap": "dev-master",
        "ashleydw/lightbox": "master",
        "knplabs/knp-menu": "dev-master as 1.1",
        "knplabs/knp-menu-bundle": "dev-master as 1.1",

        "sonata-project/intl-bundle": "dev-master",
        "jms/translation-bundle": "dev-master",
        "jms/i18n-routing-bundle": "dev-master",
        "willdurand/js-translation-bundle": "dev-master",
        "friendsofsymfony/jsrouting-bundle": "dev-master",
        "friendsofsymfony/user-bundle": "dev-master",

        "sonata-project/core-bundle": "~2.2@dev",
        "sonata-project/admin-bundle": "dev-master",
        "sonata-project/doctrine-orm-admin-bundle": "dev-master",

        "escapestudios/wsse-authentication-bundle": "dev-master",
        "nelmio/api-doc-bundle": "dev-master",
        "friendsofsymfony/rest-bundle": "dev-master",
        "jms/security-extra-bundle": "dev-master",
        "jms/serializer-bundle": "dev-master"
    },
    "repositories": [
    {
        "type": "package",
        "package": {
            "name": "jquery/jquery",
            "version": "2.0.3",
            "dist": {
                "url": "http://code.jquery.com/jquery-2.0.3.min.js",
                "type": "file"
            }
        }
    },
    {
        "type": "package",
        "package": {
            "name": "ashleydw/lightbox",
            "version": "master",
            "source": {
                "url": "https://github.com/ashleydw/lightbox.git",
                "type": "git",
                "reference": "master"
            }
        }
    }
    ],
    "scripts": {
        "post-install-cmd": [
            "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile",
            "Mopa\\Bundle\\BootstrapBundle\\Composer\\ScriptHandler::postInstallSymlinkTwitterBootstrap"
        ],
        "post-update-cmd": [
            "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile",
            "Mopa\\Bundle\\BootstrapBundle\\Composer\\ScriptHandler::postInstallSymlinkTwitterBootstrap"
        ]
    },
    "config": {
        "bin-dir": "bin",
        "component-dir": "web/components"
    },
    "minimum-stability": "dev",
    "extra": {
        "symfony-app-dir": "app",
        "symfony-web-dir": "web",
        "incenteev-parameters": {
            "file": "app/config/parameters.yml"
        },
        "branch-alias": {
            "dev-master": "2.3-dev"
        }
    }
}

Best regards

datetimepicker not working

I'm using adminbundle: dev-master and corebundle : 2.2.5

my config file here :
twig:
...
form:
resources:
- 'SonataCoreBundle:Form:datepicker.html.twig'

and here I used it in admin
$formMapper
->add('due_date','sonata_type_date_picker')
;
Please help me and update document on sonata-project site.

Thank you so much.

bootstrap.css typo ?

Resources/public/vendor/bootstrap/dist/css/bootstrap.css:

.carousel-inner > .item > a > img {
...
width: 100% \9;
...
}

.img-thumbnail {
...
width: 100% \9;
...
}

[Feature request][DateRange]label customization

I'm using the 'sonata_type_date_range' on a french website, and for the moment, I'm stuck with 'start' and 'end'. I used this solution as a workaround, but I think it is a hack since it uses the attr option, which has the side-effect to create an unnecessary html attribute.

DEPRECATED - Constants PRE_BIND, BIND and POST_BIND

Hello.

I am updated my project from symfony 2.6 to 2.7 and after update i received this deprecated message:

DEPRECATED - Constants PRE_BIND, BIND and POST_BIND in class Symfony\Component\Form\FormEvents are deprecated since version 2.3 and will be removed in 3.0. Use PRE_SUBMIT, SUBMIT and POST_SUBMIT instead.

Issue deploying on heroku

Hi,

How do i deploy assets in heroku? The app cannot find stylesheets but looks fine on my localhost

Extract forms to a new bundle

SonataCoreBundle contains great form types that are very usable also outside the Sonata project. It will be great to have them as a bundle, to not have to install the whole SonataCoreBundle just to use some of the forms.
This new bundle can contain form types, data transformers, form extensions, filter form types etc., that can be extracted from SonataCoreBundle and other sonata bundles.
@rande what do you think?

Boolean labels not translating with Symfony 2.7

We just upgraded from Symfony 2.3 to 2.7 and have noticed an issue with the latest version of SonataAdminBundle. The label_type_yes and label_type_no boolean value strings are not translating in the filter grid. At first we thought we needed to make some kind of configuration update in our application, but we could not find any issues.

I created a brand new Symfony 2.7 using the instructions in the cookbook, composer required composer require sonata-project/admin-bundle, and then created an entity with a single boolean field, and an admin for it. The label_type_yes and label_type_no still show up un-translated.

I am running PHP 5.5, Symfon 2.7.1 and have tried with SonataAdminBundle 2.3.3 and dev-master.

<?php
namespace AppBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * Bar
 *
 * @ORM\Table()
 * @ORM\Entity
 */
class Bar
{
    /**
     * @var integer
     *
     * @ORM\Column(type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

    /**
     * @var boolean
     *
     * @ORM\Column(type="boolean")
     */
    private $active;
}
<?php
namespace AppBundle\Admin;

use Sonata\AdminBundle\Admin\Admin;
use Sonata\AdminBundle\Datagrid\DatagridMapper;
use Sonata\AdminBundle\Datagrid\ListMapper;
use Sonata\AdminBundle\Form\FormMapper;
use Sonata\AdminBundle\Show\ShowMapper;

class BarAdmin extends Admin
{
    public function configureFormFields( FormMapper $form )
    {
        $form->add( 'active' );
    }

    public function configureListFields( ListMapper $list )
    {
        $list->add( 'active' );
    }

    public function configureDataGridFilters( DatagridMapper $filter )
    {
        $filter->add( 'active' );
    }

    public function configureShowFields( ShowMapper $show )
    {
        $show->add( 'active' );
    }
}
services:
  app.admin.bar:
    class: AppBundle\Admin\BarAdmin
    tags:
      - { name: sonata.admin, manager_type: orm, group: Foo, label: Bar }
    arguments:
      - ~
      - AppBundle\Entity\Bar
      - ~
    calls:
      - [ setTranslationDomain, [AppBundle]]
<select id="filter_active_value" name="filter[active][value]" class="select2-offscreen" tabindex="-1" title="Active">
  <option value=""></option>
  <option value="1">label_type_yes</option>
  <option value="2">label_type_no</option>
</select>

I had reported this at the SonataAdminBundle project, but they said the translation is dealt with in core.

composer install fails

I want to contribute to this bundle. To run the test suite, I must first install the dev dependencies. I get the following error message :

Loading composer repositories with package information
Installing dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - doctrine/phpcr-odm 1.1.2 requires phpcr/phpcr-implementation ~2.1.0 -> no matching package found.
    - doctrine/phpcr-odm 1.1.1 requires phpcr/phpcr-implementation ~2.1.0 -> no matching package found.
    - doctrine/phpcr-odm 1.1.0 requires phpcr/phpcr-implementation ~2.1.0 -> no matching package found.
    - doctrine/phpcr-odm 1.0.1 requires phpcr/phpcr-implementation ~2.1.0 -> no matching package found.
    - doctrine/phpcr-odm 1.0.0 requires phpcr/phpcr-implementation ~2.1.0 -> no matching package found.
    - Installation request for doctrine/phpcr-odm ~1.0 -> satisfiable by doctrine/phpcr-odm[1.0.0, 1.0.1, 1.1.0, 1.1.1, 1.1.2].

Potential causes:
 - A typo in the package name
 - The package is not available in a stable-enough version according to your minimum-stability setting
   see <https://groups.google.com/d/topic/composer-dev/_g3ASeIFlrc/discussion> for more details.

Read <http://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.

Sonata Core Bundle Catchable Fatal Error

Hi I work with Sonata E-commerce Bundle . After I made "composer update " and my libraries updated I had error:
Catchable Fatal Error: Argument 2 passed to Sonata\CoreBundle\Model\BaseManager::__construct() must implement interface Doctrine\Common\Persistence\ManagerRegistry, instance of Doctrine\ORM\EntityManager given, called in D:\TrainingProjects\OpenSource\test-sonata-ecommerce\app\cache\dev\appDevDebugProjectContainer.php on line 7384 and defined in D:\TrainingProjects\OpenSource\test-sonata-ecommerce\vendor\sonata-project\core-bundle\Model\BaseManager.php line 41
Any ideas what it might be.

ResizeFormListener

In ResizeFormListener onBind call preSubmit, onBind must call onSubmit.

Unable to find template "SonataCoreBundle:FlashMessage:render.html.twig" in SonataAdminBundle::standard_layout.html.twig

Hi,

Im getting this error message:

Unable to find template "SonataCoreBundle:FlashMessage:render.html.twig" in SonataAdminBundle::standard_layout.html.twig at line 188.

I have reinstalled all my vendors, but the error is the same..

This is my composer.json and my config.yml:

{
    "name": "symfony/framework-standard-edition",
    "license": "MIT",
    "type": "project",
    "description": "The \"Symfony Standard Edition\" distribution",
    "autoload": {
        "psr-0": { "": "src/" }
    },
    "require": {
        "php": ">=5.3.3",
        "symfony/symfony": "2.3.*",
        "doctrine/orm": ">=2.2.3,<2.4-dev",
        "doctrine/doctrine-bundle": "1.2.*",
        "twig/extensions": "1.0.*",
        "symfony/assetic-bundle": "2.3.*",
        "symfony/swiftmailer-bundle": "2.3.*",
        "symfony/monolog-bundle": "2.3.*",
        "sensio/distribution-bundle": "2.3.*",
        "sensio/framework-extra-bundle": "2.3.*",
        "sensio/generator-bundle": "2.3.*",
        "incenteev/composer-parameter-handler": "~2.0",
        "ziiweb/frontendbundle": "@dev",
        "friendsofsymfony/user-bundle": "~2.0@dev",
        "sonata-project/admin-bundle": "dev-master",
        "sonata-project/doctrine-orm-admin-bundle": "dev-master",
        "sonata-project/media-bundle": "dev-master"
    },
    "scripts": {
        "post-install-cmd": [
            "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile"
        ],
        "post-update-cmd": [
            "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile"
        ]
    },
    "config": {
        "bin-dir": "bin"
    },
    "minimum-stability": "stable",
    "extra": {
        "symfony-app-dir": "app",
        "symfony-web-dir": "web",
        "incenteev-parameters": {
            "file": "app/config/parameters.yml"
        },
        "branch-alias": {
            "dev-master": "2.3-dev"
        }
    }
}


imports:
    - { resource: parameters.yml }
    - { resource: security.yml }
    - { resource: @ProjectUserBundle/Resources/config/admin.yml }
    - { resource: @ProjectAdminBundle/Resources/config/admin.yml }

framework:
    #esi:             ~
    #translator:      { fallback: %locale% }
    secret:          %secret%
    router:
        resource: "%kernel.root_dir%/config/routing.yml"
        strict_requirements: ~
    form:            ~
    csrf_protection: ~
    validation:      { enable_annotations: true }
    templating:
        engines: ['twig']
        #assets_version: SomeVersionScheme
    default_locale:  "%locale%"
    trusted_proxies: ~
    session:         ~
    fragments:       ~
    http_method_override: true

# Twig Configuration
twig:
    debug:            %kernel.debug%
    strict_variables: %kernel.debug%

# Assetic Configuration
assetic:
    debug:          %kernel.debug%
    use_controller: false
    bundles:        [ ProjectFrontendBundle ]
    #java: /usr/bin/java
    filters:
        cssrewrite: ~
        sass: ~
        compass: ~
        #closure:
        #    jar: %kernel.root_dir%/Resources/java/compiler.jar
        #yui_css:
        #    jar: %kernel.root_dir%/Resources/java/yuicompressor-2.4.7.jar

parameters:
    assetic.filter.compass.images_dir: %kernel.root_dir%/../web/bundles/projectfrontend/images
    assetic.filter.compass.http_path: /bundles/projectfrontend
    assetic.filter.compass.generated_images_path: %kernel.root_dir%/../web/bundles/projectfrontend/images

# Doctrine Configuration
doctrine:
    dbal:
        driver:   %database_driver%
        host:     %database_host%
        port:     %database_port%
        dbname:   %database_name%
        user:     %database_user%
        password: %database_password%
        charset:  UTF8
        types:
        #json: Sonata\Doctrine\Types\JsonType

        # if using pdo_sqlite as your database driver, add the path in parameters.yml
        # e.g. database_path: %kernel.root_dir%/data/data.db3
        # path:     %database_path%

    orm:
        auto_generate_proxy_classes: %kernel.debug%
        auto_mapping: true
        #entity_managers:
            #default:
            #mappings:
                #SonataMediaBundle: ~

# Swiftmailer Configuration
swiftmailer:
    transport: %mailer_transport%
    host:      %mailer_host%
    username:  %mailer_user%
    password:  %mailer_password%
    spool:     { type: memory }


fos_user:
    db_driver: orm
    firewall_name: main
    user_class: Project\Bundle\UserBundle\Entity\User

knp_menu:
    twig:  # use "twig: false" to disable the Twig extension and the TwigRenderer
        template: knp_menu.html.twig
    templating: false # if true, enables the helper for PHP templates
    default_renderer: twig # The renderer to use, list is also available by default

sonata_block:
    default_contexts: [cms]
    blocks:
        sonata.admin.block.admin_list:
            contexts:   [admin]

        sonata.block.service.text:
        sonata.block.service.rss:


sonata_media:
    # if you don't use default namespace configuration
    #class:
    #    media: MyVendor\MediaBundle\Entity\Media
    #    gallery: MyVendor\MediaBundle\Entity\Gallery
    #    gallery_has_media: MyVendor\MediaBundle\Entity\GalleryHasMedia
    default_context: default
    db_driver: doctrine_orm # or doctrine_mongodb, doctrine_phpcr
    contexts:
        default:  # the default context is mandatory
            providers:
                - sonata.media.provider.dailymotion
                - sonata.media.provider.youtube
                - sonata.media.provider.image
                - sonata.media.provider.file

            formats:
                small: { width: 100 , quality: 70}
                big:   { width: 500 , quality: 70}

    cdn:
        server:
            path: /uploads/media # http://media.sonata-project.org/

    filesystem:
        local:
            directory:  %kernel.root_dir%/../web/uploads/media
    providers:
        image:
            resizer: sonata.media.resizer.custom # THIS IS OUR NEW RESIZER SERVICE
            #create:     false

#doctrine_phpcr:
    #odm:
        #auto_mapping: true
        #mappings:
            #SonataMediaBundle:
                #prefix: Sonata\MediaBundle\PHPCR


Data-date-format doesn't work anymore

My admin line :

->add('date', 'sonata_type_date_picker', array('attr' => array('data-date-format' => 'YYYY-MM-DD')))

doesn't work any-more. The data-date-format attr of the generated html is not correctly set (I have data-date-format="D MMM y" instead).

I made it work again by rolling back to 9a48895

Is there a new way to configure this parameter ? If so, the doc should be updated or the bug fixed

[Feature request][Date picker] Inject the current language if available

I want to get a datepicker in the current locale. For the moment, here is what I do :

  • add a property and its setter in my admin class
  • add a call to the setter when configuring DI for my admin class
  • use the property when creating the widget

IMO, a better way to do this would be to look for a _locale parameter in the CoreBundle extension class. If it is set, then inject in it a property of the BasePickerType class and use this property instead of 'en'.

Optionally, a check could be made to see if the js translation file exists.

missing resources when updating SonataAdminBundle

hi,

i had installed SonataAdminBundle with composer :
"sonata-project/admin-bundle": "dev-master",

All worked fine, i created an Admin Class and access to my dashboard but the menus were displayed with no style (ugly basic html

  • )
    I found that some of the Resources directories (e.g. Resources/public/vendor/components-font-awesome) were missing and after many unsuccessfully reinstall of the bundle with composer, i finally download it manually from github so now all works fine for me. Maybe an issue in a download script ?

    sorry for my french-english ^^

  • Style problem

    Hello,
    when I install the SonataAdminBundle the styles don't show properly:
    me2zs

    It happened just recently
    Thank you.

    sonata-media bundle needs new core-bundle release

    Hey guys! I'm working on a project and developed a back-office using the variety of sonata bundles. The problem is every time I try to add a new media with the sonata-media bundle I get this error:
    error

    As you can hopefully see symfony can't find the Metadata class in the vendor. Because it doesn't exist. I saw that you recently added the files. Please make a new release (because I know after adding the files in the vendor myself it works beautifully). Thanks!

    Bower integration with Spea/SpBowerBundle

    I have my sonata bundles setup with Spea/SpBowerBundle and it works like a charm.

    Is it something others might be interested in? Right now the bower integration is mentioned in the master documentation of the adminBundle but there is nothing in core.

    Maybe sp bower could be one alternative as a suggest for the bundle and the "direct" way like in the admin documentation could be included in the core docs also. What do you think?

    Right now I put the bower files inside the bundle but they could also go directly into the web/bundles/sonatacore or into app/Resources as a override somehow. I don't know whats the best practice there.

    This is the conf I am using

    sp_bower:
        bin: /usr/local/bin/bower
        assetic:
            nest_dependencies: false
        bundles:
            SonataAdminBundle:
                config_dir: .
                asset_dir: %kernel.root_dir%/../vendor/sonata-project/admin-bundle/Resources/public/vendor/
                cache: /Volumes/Drobo/Web/aktiva/presstanda/app/cache/bower
            SonataCoreBundle:
                config_dir: .
                asset_dir: %kernel.root_dir%/../vendor/sonata-project/core-bundle/Resources/public/vendor/
                cache: /Volumes/Drobo/Web/aktiva/presstanda/app/cache/bower

    DateTime error on send

    I configured the Sonata dateTime:

    ->add('startTime', 'sonata_type_datetime_picker', array(
                    'format' => 'd.m.Y, H:i:s'
                ))

    The form throwing error:

     An error has occurred during update of item "My cool item". 
    

    Message tooltip (for a datetime attribute constraint) doesnt appear

    Creating a custom constraint on a datetime field works like a charm, but the tooltip message cannot be displayed after a mouse over the same field (like it does with other field types), maybe the JQuery selector of this toogle behavior does'nt support the select/options type (unlike inputs, checkoxes and other available widget types) ...

    Bootstrap alert for errors

    Hi for all.

    Actually Sonata is generating following HTML for error information

    <div class="alert alert-error alert-dismissable">
                <button type="button" class="close" data-dismiss="alert" aria-hidden="true">ร—</button>
                // error here 
            </div>

    So in bootstrap 3 you need replace class alert-error for alert-danger

    Undefined index: flashmessage

    After composer update

    PHP Notice: Undefined index: flashmessage in vendor/sonata-project/core-bundle/Sonata/CoreBundle/DependencyInjection/SonataCoreExtension.php on line 73

    PHP Warning: array_merge(): Argument #1 is not an array in vendor/sonata-project/core-bundle/Sonata/CoreBundle/DependencyInjection/SonataCoreExtension.php on line 77

    Metadata

    The default image set in the construct when image equal to null has a problem with the sonata media bundle

    Doctrine manager error

    Got this error when running web console bundle

    FatalErrorException: Compile Error: Cannot redeclare class Sonata\CoreBundle\Entity\DoctrineBaseManager in vendor\sonata-project\core-bundle\Sonata\CoreBundle\Entity\DoctrineBaseManager.php line 23

    Files missing when assets:install on version 2.3.0

    Hi there,

    I just updated Sonata Core Bundle to the last version 2.3.0. There seems to be some issues when running assets:install, these required files are missing from the /web directory:

    web/bundles/sonatacore/vendor/select2/select2-bootstrap.css"
    web/bundles/sonatacore/vendor/ionicons/css/ionicons.min.css"
    web/bundles/sonatacore/vendor/bootstrap/dist/css/bootstrap.min.css"
    web/bundles/sonatacore/vendor/select2/select2.css"
    web/bundles/sonatacore/vendor/jquery/dist/jquery.min.js"
    web/bundles/sonatacore/vendor/bootstrap/dist/js/bootstrap.min.js"
    web/bundles/sonatacore/vendor/select2/select2.min.js"

    I'll try to downgrade now to an older version until the bug will be fixed.

    Thanks for your good work ;)

    ClassNotFoundException: Attempted to load interface "ManagerInterface"

    Tried to use MediaBundle. Did all steps following installation manual link_, but no luck
    link_:http://sonata-project.org/bundles/media/master/doc/reference/installation.html

    ClassNotFoundException: Attempted to load interface "ManagerInterface" from namespace "Sonata\CoreBundle\Model" in /opt/local/apache2/htdocs/projectx.dev/public/vendor/sonata-project/media-bundle/Sonata/MediaBundle/Model/MediaManagerInterface.php line 20. Do you need to "use" it from another namespace? Perhaps you need to add a use statement for one of the following: Sonata\CoreBundle\Entity\ManagerInterface.

    SonataCoreBundle assets are never used with other Sonata bundles

    Hello,
    I've noticed that SonataCoreBundle isntalls many vendor assets after running php app/console assets:install. However, these assets are never utilized with other Sonata bundles.

    E.g. I've instsalled SonataUserBundle which I believe should now rely on assets present in SonataCoreBundle. Unfortunately, no assets are ever loaded. This /login or /register pages display only the HTML markup. No styles are ever applied.

    How is then SonataCoreBundle integrated with other Sonata bundles?

    Master branch is unstable

    i got the following error:

    oskar.stark:/Volumes/development/workspaces/SonataCoreBundle (master)$ make test
    phpunit
    PHP Fatal error:  Uncaught Declaration of Sonata\CoreBundle\Tests\Twig\TokenParser\TemplateBoxNodeTest::testCompile() should be compatible with Twig_Test_NodeTestCase::testCompile($node, $source, $environment = NULL, $isPattern = false)
    
    /Volumes/development/workspaces/SonataCoreBundle/vendor/symfony/phpunit-bridge/DeprecationErrorHandler.php:40
    /Volumes/development/workspaces/SonataCoreBundle/Tests/Twig/Node/TemplateBoxNodeTest.php:20
    
      thrown in /Volumes/development/workspaces/SonataCoreBundle/Tests/Twig/Node/TemplateBoxNodeTest.php on line 20
    
    Fatal error: Uncaught Declaration of Sonata\CoreBundle\Tests\Twig\TokenParser\TemplateBoxNodeTest::testCompile() should be compatible with Twig_Test_NodeTestCase::testCompile($node, $source, $environment = NULL, $isPattern = false)
    
    /Volumes/development/workspaces/SonataCoreBundle/vendor/symfony/phpunit-bridge/DeprecationErrorHandler.php:40
    /Volumes/development/workspaces/SonataCoreBundle/Tests/Twig/Node/TemplateBoxNodeTest.php:20
    
      thrown in /Volumes/development/workspaces/SonataCoreBundle/Tests/Twig/Node/TemplateBoxNodeTest.php on line 20
    
    make: *** [test] Error 255

    Smart REST behavior for boolean parameters in API

    When using the API, boolean parameters on POST/PUT requests are not working as naturally expected.

    Currently:

    • No data passed for a boolean value will be handled as "false"
    • Any data passed (including 0, false, etc.) will be handled as "true"

    In REST context, we would expect that if we are providing false or 0 as boolean value it would lead to a final "false".

    This behavior is related to the use of forms. A solution can be to use a custom Data Transformer for these cases proper to the API context.

    Cannot redeclare class ManagerInterface after updating with composer!

    Hm, I've done update of my sonata admin app and get the following:

    FatalErrorException: Compile Error: Cannot redeclare class Sonata\CoreBundle\Entity\ManagerInterface in /Applications/MAMP/htdocs/sonatapp/vendor/sonata-project/core-bundle/Sonata/CoreBundle/Entity/ManagerInterface.php line 21

    I'm not sure what to do and how to fix the issue. Some can help?

    Edit: I've figured out that the issue occurs only with the TimelineBundle and AuditBundle. So if one of this Bundle is used or included into the Dashboard so the error occurs.

    If you don't use one of these 2 Bundles it should be worked as expected.

    MomentFormatConverter confusion

    I was working on #64 and I didn't like how the MomentFormatConverter worked because I ended up adding a lot of mappings.

    I want to improve the class, and this can be easily done by creating a mapping between format character in PHP to format character(s) in moment.js (i.e: 'H' => 'HH').

    The MomentFormatConverter states that it stores mapping between PHP and moment.js, but that makes no sense because https://github.com/sonata-project/SonataCoreBundle/blob/master/Date/MomentFormatConverter.php#L38 is not a valid PHP format string. All PHP format characters are only one character in length.

    Once I know what MomentFormatConverter is really trying to do, I can try to improve it.

    Select2 plugin is missplaced

    I cloned Sonata Admin Sandbox and try to deploy it via ansible the standard way including assetic:dump command. But it fails with error:

    [RuntimeException]
    The source file "/var/www/sonata/releases/1417564749/app/../web/bundles/sonatacore/vendor/select2/select2.js" does not exist.
    

    The path in assetic.yml is right , but the actual select2 plugin is placed in a Resources/public instead of Resources/public/vendor. I think it will be pretty easy to fix.

    Also I noticed that Sonata Admin Bundle doesn't reuse either of Sonata Core Bundle vendor assets (jquery, bootstrap, etc.), which looks like an issue to me since it depends on it.

    P.S.

    I hope someday we all will just stop committing vendor js/css libraries and go with bower, which you already do, but not in every part of the project :)

    Best wishes, you are doing an awesome job guys!

    Boolean type is not i18n

    In form/type/booleantype.php, choices "label_type_yes" and "label_type_no" are not translate like in equaltype.php

    problem composer update and Fos User Bundle Can't inherit abstract function

    PHP Fatal error:  Can't inherit abstract function Sonata\CoreBundle\Model\ManagerInterface::getClass()
     (previously declared abstract in FOS\UserBundle\Model\UserManagerInterface) in 
    /home/aismt/vendor/sonata-project/user-bundle/Entity/UserManager.php on line 25
    

    My version of "sonata-project/core-bundle" is "dev-master@dev"

    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.