GithubHelp home page GithubHelp logo

sonata-project / sonatanewsbundle Goto Github PK

View Code? Open in Web Editor NEW
151.0 27.0 131.0 1.9 MB

[Abandoned] Symfony SonataNewsBundle

Home Page: https://docs.sonata-project.org/projects/SonataNewsBundle

License: MIT License

PHP 92.23% Makefile 0.76% Twig 7.01%
blog bundle news php post sonata symfony symfony-bundle

sonatanewsbundle's Introduction

SonataNewsBundle

Symfony SonataNewsBundle

Latest Stable Version Latest Unstable Version Psalm Type Coverage License

Total Downloads Monthly Downloads Daily Downloads

Branch Github Actions Code Coverage Documentation
3.x Test Coverage Status Documentation Status
4.x Test Coverage Status Documentation Status

WARNING: This repository is abandoned

There is no active support on it.

Feel free to ask if you want to help to keep this project up to date.

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.

sonatanewsbundle's People

Contributors

bladrak avatar core23 avatar covex-nn avatar edwines avatar emmanuelvella avatar franmomu avatar gam6itko avatar greg0ire avatar helmer avatar jaimesuez avatar jordisala1991 avatar jubalh avatar kasp3r avatar konstantinzolotarev avatar oskarstark avatar pborreli avatar plouc avatar pulse00 avatar pulzarraider avatar rande avatar rosier avatar sagikazarmark avatar sonataci avatar soullivaneuh avatar sylvaindeloux avatar vihuvac avatar vincentlanglet avatar vyshkant avatar wbloszyk avatar wharenn 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

sonatanewsbundle's Issues

No route found for "GET /admin/"

Hi

It 's installed but when i log in as admin, got redirecttion to /admin and got this error:

No route found for "GET /admin/"

I don't understand...

Here my routing.yml

homepage:
pattern: /
defaults: { _controller: SonataPageBundle:Page:catchAll }

fos_user_security:
resource: "@FOSUserBundle/Resources/config/routing/security.xml"

fos_user_profile:
resource: "@FOSUserBundle/Resources/config/routing/profile.xml"
prefix: /profile

fos_user_register:
resource: "@FOSUserBundle/Resources/config/routing/registration.xml"
prefix: /register

fos_user_resetting:
resource: "@FOSUserBundle/Resources/config/routing/resetting.xml"
prefix: /resetting

fos_user_change_password:
resource: "@FOSUserBundle/Resources/config/routing/change_password.xml"
prefix: /change-password

gallery:
resource: '@SonataMediaBundle/Resources/config/routing/gallery.xml'
prefix: /media/gallery

media:
resource: '@SonataMediaBundle/Resources/config/routing/media.xml'
prefix: /media

blog:
resource: '@SonataNewsBundle/Resources/config/routing/news.xml'
prefix: /blog

admin:
resource: '@SonataAdminBundle/Resources/config/routing/sonata_admin.xml'
prefix: /admin

_sonata_admin:
resource: .
type: sonata_admin
prefix: /admin

soanata_user:
resource: '@SonataUserBundle/Resources/config/routing/admin_security.xml'
prefix: /admin

thanks for your help
Bye

ModelManagerInterface.addIdentifiersToQuery

hello,

I think shoud be:

/**
 * @param string                                           $class
 * @param \Sonata\AdminBundle\Datagrid\ProxyQueryInterface $query
 * @param array                                            $idx
 *
 * @return void
 */
function addIdentifiersToQuery($class, ProxyQueryInterface $query, array $idx); // missing array keyword, cause fatal error

:)
Jaco

Comment batch action not working

When using the batch actions batch_enable_comments or batch_disable_comments, the following exception is triggered :

A Sonata\AdminBundle\Controller\CRUDController::batchActionEnabled method must be created

Or

A Sonata\AdminBundle\Controller\CRUDController::batchActionDisabled method must be created

DEPRECATION - get() is deprecated since version 2.1 message in 46ee989

Not sure whether it belongs here, or over at the SonataAdminBundle repo.

Using SonataNewsBundle version 46ee989,
Creating a new post using http://[host]//app_dev.php/admin/sonata/news/post/create the profiler toolbar throws the following warning 5 times:

DEPRECATION - get() is deprecated since version 2.1 and will be removed in 2.3. Access the public property 'vars' instead.  
Called from FormView::get() at line 68
Called from FormatterType::buildView() at line 193
Called from ResolvedFormType::buildView() at line 140
Called from ResolvedFormType::createView() at line 1047
Called from Form::createView() at line 144
Called from ResolvedFormType::createView() at line 1047
Called from Form::createView() at line 513
Called from CRUDController::createAction()

ModelManagerException when set author or category

Hi,

I've installed SonataNewsBundle and SonataAdminBundle, when i create new post without set author and category the post was created perfectly but if i set author or category i receive this exception:

Sonata\AdminBundle\Exception\ModelManagerException: (uncaught exception) at /[...]/vendor/bundles/Sonata/DoctrineORMAdminBundle/Model/ModelManager.php line 115

This happens after today:

php bin/vendors update

Thanks for help and sorry for my english

HelperController service injection failure

When editing a blog post in the generated admin interface, i'm getting the following error:

An exception has been thrown during the rendering of a template
 ("Catchable Fatal Error: Argument 1 passed to 
Sonata\AdminBundle\Controller\HelperController::__construct() 
must be an instance of Twig_Environment, none given, called in 
/Users/username/Sites/project/symfony/app/cache/dev/classes.php on line 4582 
and defined in 
/Users/username/Sites/project/symfony/vendor/bundles/Sonata/AdminBundle/Controller/HelperController.php
 line 50") in SonataDoctrineORMAdminBundle:CRUD:edit_orm_many_to_one.html.twig at line 23. 

Markdown won't parse media on production

In production the markdown parser doesnot correctly parse the images. On production a <% media 1, 'small'%> tag is parsed to nothing. Just leaves the a blank space, so the literal tag is parsed but to nothing instead of an image. On dev it works correctly.

sonata_news.yml

sonata_news:
  title:        "Mon titre"
  link:         http://sonata-project.org
  description:  Cool bundles on top of Symfony2  
  salt:         'safdsadfsadfsadfsafd'

  comment:
    notification:
        emails:   [[email protected]]
        from:     [email protected]
        template: 'SonataNewsBundle:Mail:comment_notification.txt.twig'

doctrine:
  orm:
    entity_managers:
      default:
        #metadata_cache_driver: apc
        #query_cache_driver: apc
        #result_cache_driver: apc
        mappings:
          ApplicationSonataNewsBundle: ~
          SonataNewsBundle: ~

sonata_formatter:
    formatters:
        markdown:
            service: sonata.formatter.text.markdown
            extensions:
                - sonata.formatter.twig.control_flow
                - sonata.formatter.twig.gist
                - sonata.media.formatter.twig      

sonata_media.yml

sonata_media:
  db_driver: doctrine_orm
  default_context: default
  contexts:
    default: # the default context is mandatory
      providers:
        - sonata.media.provider.dailymotion
        - sonata.media.provider.youtube
        - sonata.media.provider.image
        - sonata.media.provider.file
        - sonata.media.provider.vimeo
      formats:
        small: { width: 715, quality: 95}
        big: { width: 1024 , quality: 95}
    category:      
      providers:
        - sonata.media.provider.image      
      formats:
          small: { width: 250 , quality: 95}
          big:   { width: 500 , quality: 90}
  cdn:
      server:
        path: /uploads/media # 
  filesystem:
      local:
        directory: %kernel.root_dir%/../web/uploads/media
        create: true

doctrine:
  orm:
    entity_managers:
      default:
        mappings:
          ApplicationSonataMediaBundle: ~
          SonataMediaBundle: ~

config_dev.yml


imports:
    - { resource: config.yml }

framework:
    router:   { resource: "%kernel.root_dir%/config/routing_dev.yml" }
    profiler: { only_exceptions: false }

web_profiler:
    toolbar: true
    intercept_redirects: false

monolog:
    handlers:
        main:
            type:  stream
            path:  %kernel.logs_dir%/%kernel.environment%.log
            level: debug
        firephp:
            type:  firephp
            level: info

assetic:
    use_controller: true

config_prod.yml


imports:
    - { resource: config.yml }

#doctrine:
#    orm:
#        metadata_cache_driver: apc
#        result_cache_driver: apc
#        query_cache_driver: apc

monolog:
    handlers:
        main:
            type:         fingers_crossed
            action_level: error
            handler:      nested
        nested:
            type:  stream
            path:  %kernel.logs_dir%/%kernel.environment%.log
            level: debug

Add an option to only allow logged in user to post comment

It would be nice to have a boolean configuration option to choose if we want the visitor to be logged in in order to post a comment on a news.
If it's enabled, the form will only have a message field, all other information are retrieved from the use object.
Otherwise, the current behaviour is kept.

The field Application\Sonata\NewsBundle\Entity\Post#comments is on the inverse side of a bi-directional relationship

I am extending the News bundle as for the documentation and everything seems to works on the surface but the debugger throw this errors:

Application\Sonata\NewsBundle\Entity\Post

The field Application\Sonata\NewsBundle\Entity\Post#comments is on the inverse side of a bi-directional relationship, but the specified mappedBy association on the target-entity Application\Sonata\NewsBundle\Entity\Comment#post does not contain the required 'inversedBy=comments' attribute.

Application\Sonata\NewsBundle\Entity\Tag

The field Application\Sonata\NewsBundle\Entity\Tag#posts is on the inverse side of a bi-directional relationship, but the specified mappedBy association on the target-entity Application\Sonata\NewsBundle\Entity\Post#tags does not contain the required 'inversedBy=posts' attribute.

Digging in it i found out that if i modify SonataNewsExtension.php adding the required attributes the errors are gone but i can't find the proper way to override that file from the extension.

Error: "Unable to find the post"

PROBLEM:

Created first post.

went to /news, it displayed the post.

Clicked on title of post, got the following error: "Unable to find the post "

SOLUTION:

Problem is caused because publication_date_start is NULL in database.

So, add publication_date_start to edit form for post so it is saved when post is created.

This is done in PostAdmin.php.

Impossible to have bundle with symfony 2.2.x

It's impossible to have installed the bundle with symfony 2.2.x I think there is a dependency problem.

- sonata-project/news-bundle dev-master requires symfony/symfony >=2.3,<2.4-dev -> satisfiable by symfony/symfony[2.3.x-dev, v2.3.0].
- remove sonata-project/news-bundle 2.2.x-dev|keep sonata-project/news-bundle dev-master
- Can only install one of: symfony/symfony[v2.2.2, 2.3.x-dev].
- Can only install one of: symfony/symfony[v2.3.0, v2.2.2].
- Installation request for sonata-project/news-bundle 2.2.x-dev -> satisfiable by sonata-project/news-bundle[2.2.x-dev].

Any idea?

description field at the list

The value of the description doesn't appear at the list of categories

It is because of a spell problem at line 53 int the file "Admin/CategoryAdmin.php", in which The word "description" is written like "deescription" an additional "e" in the word .

The same error exist at the translations fils

Would you like to fix this problem

Error in install

One error appear in README.rst :

new Knp\Bundle\MarkdownBundle\KnpMarkdownBundle() instead of new Knp\Bundle\KnpMarkdownBundle()
+
you forgot 'FOS' => DIR.'/../vendor/bundles',

I have some difficulty to find "php app/console sonata:easy-extends:generate SonataNewsBundle"

And http://symfony2bundles.org/fr/sonata-project/SonataNewsBundle need to be update or foward to https://github.com/sonata-project/SonataNewsBundle/blob/master/README.rst

Do you have a example in action of this Bundle ?

Missing Category Filter in PostManager::getPager

missing the following code when displaying archives as categories


        if (isset($criteria['category'])) {
          $query->andWhere('p.category = :categoryid');
          $parameters['categoryid'] = $criteria['category']->getId();
        }

custom field

I add a custom field in post:

in /vendor/bundles/Sonata/NewsBundle/Resources/config/doctrine/Post.orm.xml.skeleton I add my custom field

<?xml version="1.0" encoding="utf-8"?>
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" xsi="http://www.w3.org/2001/XMLSchema-instance" schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd">
    <!--
         This file has been generated by the EasyExtends bundle ( http://sonata-project.org/easy-extends )

         References :
            xsd                  : https://github.com/doctrine/doctrine2/blob/master/doctrine-mapping.xsd
            xml mapping          : http://www.doctrine-project.org/projects/orm/2.0/docs/reference/xml-mapping/en
            association mapping  : http://www.doctrine-project.org/projects/orm/2.0/docs/reference/association-mapping/en
    -->
    <entity
        name="Application\Sonata\NewsBundle\Entity\Post"
        table="news__post"
        repository-class="Application\Sonata\NewsBundle\Entity\PostRepository">

        <id name="id" type="integer" column="id">
            <generator strategy="AUTO"/>
        </id>
        <one-to-one field="podcast" target-entity="RadioSolution\PodcastBundle\Entity\Podcast" inversed-by="Application\Sonata\NewsBundle\Entity\Post">
            <join-column name="podcast_id" referenced-column-name="id" />
        </one-to-one>   
    </entity>
</doctrine-mapping>

I create a custom admin class

<?php

namespace Application\Sonata\NewsBundle\Admin;

use Sonata\AdminBundle\Admin\Admin;
use Sonata\AdminBundle\Form\FormMapper;
use Sonata\AdminBundle\Datagrid\DatagridMapper;
use Sonata\AdminBundle\Datagrid\ListMapper;
use Sonata\AdminBundle\Show\ShowMapper;
use Sonata\FormatterBundle\Formatter\Pool as FormatterPool;
use Sonata\NewsBundle\Admin\PostAdmin as BaseAdmin;


use Knp\Menu\ItemInterface as MenuItemInterface;

use Application\Sonata\NewsBundle\Entity\Comment;

class PostAdmin extends BaseAdmin
{

    /**
     * {@inheritdoc}
     */
    protected function configureFormFields(FormMapper $formMapper)
    {
        $formMapper
            ->with('General')
                ->add('enabled', null, array('required' => false))
                ->add('author', 'sonata_type_model', array(), array('edit' => 'list'))
                ->add('category', 'sonata_type_model', array(), array('edit' => 'list'))
                ->add('title')
                ->add('abstract')
                ->add('contentFormatter', 'sonata_formatter_type_selector', array(
                    'source' => 'rawContent',
                    'target' => 'content'
                ))
                ->add('rawContent','textarea', array('attr' => array('class' => 'tinymce', 'tinymce'=>'{"theme":"medium"}')))
            ->end()
            ->with('podcast')
                ->add('podcast','sonata_type_model', array('required' => false))
            ->end()
            ->with('Tags')
                ->add('tags', 'sonata_type_model', array('expanded' => true))
            ->end()
            ->with('Options')
                ->add('publicationDateStart')
                ->add('commentsCloseAt')
                ->add('commentsEnabled', null, array('required' => false))
                ->add('commentsDefaultStatus', 'choice', array('choices' => Comment::getStatusList(), 'expanded' => true))
            ->end()
        ;
    }
}

I declare my service:

services:
    sonata.news.admin.post:
        class: Application\Sonata\NewsBundle\Admin\PostAdmin
        tags:
            - { name: sonata.admin,manager_type: orm, group:"sonata_blog", label:"posts",  label_catalogue:"%sonata.news.admin.post.translation_domain%", label_translator_strategy:"sonata.admin.label.strategy.underscore"}
        arguments: [null,Application\Sonata\NewsBundle\Entity\Post, SonataAdminBundle:CRUD]

but I get an error when I edit a post

An exception has been thrown during the rendering of a template ("unable to find the routesonata.news.admin.post|sonata.news.admin.comment.list") in SonataAdminBundle::standard_layout.html.twig at line 18.

you can see my project https://github.com/DILL44/euradio/tree/master

Incompatibility with Oracle

I just installed this bundle and when I try to execute the /news/archive route using Oracle as database, I get this error:

ORA-01791: not a SELECTed expression") in SonataNewsBundle:Post:archive.html.twig at line 17. 

This is the query (generated by Doctrine) which causes the error:

SELECT DISTINCT n0_.id AS ID0
FROM news__post n0_
LEFT JOIN news__post_tag n2_ ON n0_.id = n2_.post_id
LEFT JOIN news__tag n1_ ON n1_.id = n2_.tag_id AND (n1_.enabled = 1)
LEFT JOIN fos_user_user f3_ ON n0_.author_id = f3_.id AND (f3_.enabled = 1)
WHERE n0_.enabled = ?
ORDER BY n0_.publication_date_start DESC

It seems like Oracle doesn't like the combination of ORDER BY and DISTINCT. This is a description of this error code I found on the internet:
"The query is a SELECT DISTINCT query with an ORDER BY clause. In this context, all ORDER BY items must be constants, SELECT list expressions, or expressions whose operands are constants or SELECT list expressions."

format_date in twig problem

I use symfony 2.0.16
I have an error: The filter "format_date" does not exist.
Did you mean "format_file" in SonataNewsBundle:Post:archive.html.twig ?
I changed format_date to date in archive.html.twig, view.html.twig, comment.html.twig and it's works

Problem with Cyrillic titles

It's not possible to give Cyrillic title for post, category or tag.

The problem in

in vendor\sonata-project\news-bundle\Sonata\NewsBundle\Model\Tag.php at line 139
// transliterate
if (function_exists('iconv')) {
$text = iconv('utf-8', 'us-ascii//TRANSLIT', $text);
}

Explanation of problem is here: http://stackoverflow.com/questions/11915330/iconv-notice-iconv-function-iconv-detected-an-illegal-character-in-input

It will be better to use https://github.com/jbroadway/urlify instead of http://snipplr.com/view/22741/slugify-a-string-in-php/ for slugify() method.

null and empty validation errors on post create

I just can't find what is wrong. Every time i save a news post via admin bundle i get 2 validation errors. I've tried to give some test value for every field and it doesn't help. I don't see any specific validation constraints. And it looks like every field is validated with no errors.
I can create some sort of fixture that will fill my database with test news data and it'll be enough for me at this time. But i want to fill it via admin interface in future. Is there any chance you'll fix it quick?

DEPRECATION - isValid() is deprecated since version 2.1

Again, not sure whether it belongs here or with SonataAdminBundle

DEPRECATION - isValid() is deprecated since version 2.1 and will be removed in 2.3. Implement validate() instead.  
Called from ConstraintValidator::validate() at line 402
Called from ExecutionContext::executeConstraintValidators() at line 299
Called from ExecutionContext::validateValue() at line 117
Called from ValidationVisitor::visit() at line 107
Called from ClassMetadata::accept() at line 169
Called from ValidationVisitor::validate() at line 285
Called from ExecutionContext::validate() at line 59
Called from FormValidator::validate() at line 402

Create possibility to customize Admin classes

So, my problem is that i want to change/customize admin behavior of NewsBundle. For instance: I want to add field 'rating' to the Post entity and i want to be able to edit this field from SonataAdmin interface. There are lots any other examples.

But, I'm not really sure whether that possibility exists. If it does tell me plz hot to use it, i've not found any mentions about it in doc files. If it does't, it would be nice to have such feature.

As guess of an implementation, it can be implemeted with usage SonataEasyExtendBundle โ€” the same as with entities.
So, SonataEasyExtendBundle generates _Admin classes in Apllication/Soanta/NewsBundle/Admin directory derived from Sonata/NewsBundle/Admin/_Admin classes. I hope the idea is clear.

Thanks.

Error

Hi, got this error when i try to do : php bin/vendors install

[Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException]
The service "sonata.news.admin.post" has a dependency on a non-existent service "sonata.formatter.pool".

I don't undersatnd...thanks for your help

I am on SF 2.0.6

Problem to delete post via batch action

Hello, when i try to delete a post via batch action i get this error.

Iterate with fetch join in class Application\Sonata\NewsBundle\Entity\Post using association tags not allowed.

Thank you for some help.

unable to create post

please select one of these options

my options are empty...

How to configure options ?

Thanks

[Bug] Unable to create Post

It is impossible to create a new Post currently, form validation fails with:

This value should not be null
This value should not be blank

Having iterated over form and all of its children, everything but the main container (form itself) is valid. I traced down thru DelegatingValidator to element data.content and there I got stuck. Imo this field is never added to the form, yet somehow validation is run upon it and it fails. It has most likely something to do with FormatterBundle, but I could not quite figure it out atm.

Any ideas?

On opening new item: requires that you provide a value for the "$postId"

Get the followin exception when I open a news item in the standard implementation:

An exception has been thrown during the rendering of a template ("Controller "Sonata\NewsBundle\Controller\PostController::commentsAction()" requires that you provide a value for the "$postId" argument (because there is no default value or because there is a non optional argument after this one).") in SonataNewsBundle:Post:view.html.twig at line 44.

EasyExtends builds corrupted PostRepository file

Latest RC4 with latest NewsBundle and latest EasyExtends as of today.

Parse error: syntax error, unexpected '{', expecting T_STRING in C:\Program Files (x86)\Zend\Apache2\htdocs\BaruchHaBa\src\Application\Sonata\NewsBundle\Entity\PostRepository.php on line 13

{{ class }} is not being replaced with the proper class names.

problems for install SonataNewsBundle

Hello,

when i install this bundle, I have some problems with this command line :

php app/console sonata:easy-extends:generate SonataNewsBundle

[InvalidArgumentException]
Bundle "ApplicationSonataNewsBundle" does not exist or it is not enabled.

Why this error, while it is precisely this command to create this bundle?

Comments are always closed in comment view

PROBLEM:

Even if the CommentsCloseAt date is in the future, comments are still closed on the front end, so the comment form doesn't show.

SOLUTION:

In BasePost:isCommentable(), the invert property is being used incorrectly to determine whether the commentsCloseAt date is in the future.

Change:

return $this->getCommentsCloseAt()->diff(new \DateTime)->invert == 0 ? true : false;

TO

return $this->getCommentsCloseAt()->diff(new \DateTime)->invert == 1 ? true : false;

Bundle not available via composer

The bundle seems to be the only sonata bundle which is not available via composer:

  [Composer\DependencyResolver\SolverProblemsException]                 
  [Job(cmd=install, target=sonata-project/news-bundle, packages=[]), ]  

Add Event Feature

To manage events or upcoming events of a website.

For default frontend, I use jquery full-calendar

News preview shows up as text

Hello,

when showing a news in the administration, the news abstract and content are display as pure text instead of HTML.

sql error with postgresql

i just installed news bundle and trying to view /news/archive route, i get this:

SQLSTATE[42803]: Grouping error: 7 ERROR: column "n0_.publication_date_start" must appear in the GROUP BY clause or be used in an aggregate function
LINE 1: ...enabled = 'true') WHERE n0_.enabled = $1 ORDER BY n0_.public...

i can't trace to the root cause.

is not a valid entity or mapped super class.

I'm new to sy and just wanted to test out this bundle, but i always get the following message:

Class Application\Sonata\NewsBundle\Entity\Post is not a valid entity or mapped super class.

What did i do wrong?
i followed all of the installation instructions, and i created several new projects, just to ensure i did not do any mistakes

Thumbnails for news articles? Missing translation!?

How to add a media entry (image) to a post?

It seems that the bundle was ment to work with SonataMediaBundle and include thumbnails of images we could upload to an article / post, but I cant seem to find such functionality in the admin panel, nor in any of the twig templates for that matter.

Also I would like to point that, in my case at least, there is quite a big chunk of missing translation (even in english), am I using the wrong branch (2.0) again or what!?

problem for instal NewsBundle

Hello,
I use symfony2 BETA3. and I have a problem to instal NewsBundle.
My error is : ServiceNotFoundException: The service "sonata.news.admin.post" has a dependency on a non-existent service "fos_user.user_manager".
Do you have any idea where the problem may come ?

Protect against spam

We're having some spam problems on a clients blog - the first approach was to implement a reCaptcha validation. However, spam is still incoming.

Has anyone experience with protecting properly against spam?

Unrecognized field: created_at while trying to get number of comments

Hello,

I try to display on my "archive" page the number of comments for each post.
When I try to access to the property like this in archive.html.twig

{% for post in pager.getResults() %}
{{ post.getComments|length }}
{% else %}
{{ 'no_post_found'|trans({}, 'SonataNewsBundle') }}
{% endfor %}

I get :

An exception has been thrown during the rendering of a template ("Unrecognized field: created_at")

Do you have a trick to get the number of comments, validated if possible, for each post ?

Thanks

Error when installing the bundle

I have try to install the bundle ass instructed in the installation guide.

But when I try to extend the news bundle it trows the following error:

"Bundle "ApplicationSonataNewsBundle" does not exist or it is not enabled."

So what is wrong?

Thanks

Unmet dependencies with SonataFormatterBundle and SonataNewsBundle

Hello

SonataNewsBundle requires SonataFormatterBundle and KnpMarkdownBundle (both master branch), SonataFormatterBundle also requires KnpMarkdownBundle, but in version 1.1.*.

I think therefore it is not possible to install SonataNewsBundle. Will it resolved?

Regards
Piotr Minkina

TinyMCE editor for news content.

What do you think about adding an ability to enable TinyMCE editor for post content ? It could be an optional feature and enable/disable in config.
After that we could add an ability to upload images from editor. I could help with coding, but I'm not sure this feature is needed.

How to translate default status choice form Comment::getStatusList()?

Hi,

I've been trying to translate this by adding

valid: Accept
invalid: Discard
moderate: Moderate

To:

  • src/ApplicationSonataNewsBundle\Resources\translations\SonataNewsBundle.en.yml
  • src/ApplicationSonataNewsBundle\Resources\translations\messages.en.yml
  • app\Resources\translations\SonataNewsBundle.en.yml
  • app\Resources\translations\messages.en.yml
  • src/ApplicationSonataAdminBundle\Resources\translations\SonataAdminBundle.en.yml
  • src/ApplicationSonataAdminBundle\Resources\translations\messages.en.yml

And ofcourse clearing my cache (for both --env=prod and --env=dev) with

php app/console cache:clear --no-warmup --env=...

But none of these seem to work.

I also tried editing vendor/bundles/Sonata/NewsBundle/Admin/PostAdmin.php on line 81

//    ->add('commentsDefaultStatus', 'choice', array('choices' => Comment::getStatusList(), 'expanded' => true))
      ->add('commentsDefaultStatus', 'sonata_type_translatable_choice', array('choices' => Comment::getStatusList(), 'expanded' => true))            

But this also did not help.

How can I translate these choices?

Build:
clone of sonata-project/sandbox (symfony 2.0.12)

Doctrine ORM Can only post 1 comment

After trying to implement this bundle I ran into an issue that would only allow 1 comment to be posted per post. The problem is in orm mapping of the SonataNewsExtension of the DI. See line 228 as comments post field is set at OneToOne, should be ManyToOne.

228 : $collector->addAssociation($config['class']['comment'], 'mapOneToOne', array(

replace with

228: $collector->addAssociation($config['class']['comment'], 'mapManyToOne', array(

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.