Giter Site home page Giter Site logo

odiseoteam / syliusblogplugin Goto Github PK

View Code? Open in Web Editor NEW
35.0 35.0 18.0 1.78 MB

This plugin add blog capabilities to your Sylius project.

License: MIT License

Gherkin 4.44% PHP 72.19% JavaScript 3.59% Twig 19.78%
blog blog-engine php plugin sylius sylius-plugin symfony

syliusblogplugin's People

Contributors

andriusvo avatar bigboss86 avatar dragosprotung avatar emilmassey avatar gregcop1 avatar matthiez avatar seizan8 avatar songecko 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

Watchers

 avatar  avatar  avatar  avatar  avatar

syliusblogplugin's Issues

Final repository classes

Is there any reason for repositories to be final?
Now I have to extend bundle repository and copy all methods.

ERR 500 : Article without pictures

Hi,

I'm running on Sylius 1.7 with the last version of your plug-in.
After installed successfully your bundle. I have created a blog categorie which work.
After that, I've created an articles without any pictures. Then I got an 500 error when going on the articles index (admin/blog/articles/).

Logs :
Return value of Odiseo\\BlogBundle\\Model\\Article::getImages() must implement interface Doctrine\\Common\\Collections\\Collection, null returned at C:\\Users\\xxx\\Desktop\\xxx\\xxxx\\website\\vendor\\odiseoteam\\blog-bundle\\src\\Model\\Article.php:159)"} []

Template reference "SyliusUiBundle:Macro:messages.html.twig" not found

I was having this issue with installation of odiseoteam/[email protected] and visiting /blog/articles route:

Template reference "SyliusUiBundle:Macro:messages.html.twig" not found, did you mean "@SyliusUi/Macro/messages.html.twig" in @OdiseoSyliusBlogPlugin/Shop/Article/index.html.twig at line 3

It appears to work be updating the template reference as recommended in src/Resources/views/Shop/Article/index.html.twig.

- {% import 'SyliusUiBundle:Macro:messages.html.twig' as messages %}
+ {% import '@SyliusUi/Macro/messages.html.twig' as messages %}

No identifier primary/key

Hello,

I've made an composer intall this morning and since i've this error :

No identifier/primary key specified for Entity "Odiseo\SyliusBlogPlugin\Entity\Article" sub class of "Odiseo\BlogBundle\Model\Article". Every Entity must have an identifier/primary key.

What can i do ? Thank you

Sylius: 1.10.14
odiseoteam/sylius-blog-plugin : v1.3.5

Typo in templates

There are 2 minor typos in 2 templates:

views/Shop/Article/_comment.html.twig line 25:
'redurectParameters': {'slug': comment.article.slug }
should be:
'redirectParameters': {'slug': comment.article.slug }

and

views/Shop/Article/show.html.twig line 65:
'redurectParameters': {'slug': article.slug }
should be:
'redirectParameters': {'slug': article.slug }

I will make a pull request over the weekend.
Cheers!

Resume Article content, HTML encoding in list of articles

The HTML encoding for article.content in list of articles is not good.

I have this when I use accents in my content of article :
image

So to fix this we need to change in OdiseoSyliusBlogPlugin/views/Shop/Article/index.html.twig

REMOVE :

<p>{{ article.content|striptags|length > 200 ? article.content|striptags|slice(0, 200) ~ '...' : article.content|striptags }}</p>

ADD :

<p>
{% if article.content|striptags|length > 200 %}
 {{ article.content|striptags|slice(0, 200)|raw }}...
{% else %}
 {{ article.content|raw }}
{% endif %}
</p>

The result is :
image

ERR 500 : ArticleComment, getAuthor() undefined method

Hi,

I'm using Sylius 1.7 with your last version of your plug-in.
After created my categorie and my article. I tried to see it on my website (in the shop).
I'm also getting an error 500 on the article page ({_locale}/blog/articles/{code}).

It throw this error because of a non-existing getter : getAuthor() in ArticleComment of your BlogBundle (not the SyliusBlogBundle).
It try to get the author in this form : ArticleUserCommentTypeExtension of your SyliusBlogBundle.

at C:\\Users\\xx\\Desktop\\xx\\xx\\website\\vendor\\twig\\twig\\src\\Loader\\FilesystemLoader.php:250, Symfony\\Component\\ErrorHandler\\Error\\UndefinedMethodError(code: 0): Attempted to call an undefined method named \"getAuthor\" of class \"Odiseo\\BlogBundle\\Model\\ArticleComment\". at C:\\Users\\xx\\Desktop\\xx\\ xx\\website\\vendor\\odiseoteam\\sylius-blog-plugin\\src\\Form\\Extension\\ArticleUserCommentTypeExtension.php:24)"} []

Error: non-existent parameter "odiseo_blog.model.article.class".

Hi there,

after installing the bundle on a clean sylius 1.9.2 I get the following error:

In ParameterBag.php line 98:
You have requested a non-existent parameter "odiseo_blog.model.article.class".

I followed every step inside the documentation except the one with the API, that I dont want to use.

Composer installer

Hello
I have error when I try instal by composer

The service "odiseo_sylius_blog_plugin.factory.article_comment" has a dependency on a non-existent service "odiseo_blog.factory.article_comment".

Any idea how to fix this ?

Unable to install the Plugin on Sylius 1.9.2 and Sylius 1.8.5

Hi,
I was trying to get the Plugin running on Sylius 1.9.2 and also Sylius 1.8.5 but without success.

I do get the following errors:

Problem 1
- odiseoteam/sylius-blog-plugin[v1.2.0, ..., v1.2.2] require odiseoteam/blog-bundle ^1.1 -> satisfiable by odiseoteam/blog-bundle[v1.1.0, ..., v1.1.23].
- odiseoteam/blog-bundle[v1.1.0, ..., v1.1.6] require symfony/framework-bundle ^3.4|^4.1 -> found symfony/framework-bundle[v3.4.0, ..., v3.4.47, v4.1.0, ..., v4.4.22] but the package is fixed to v5.2.5 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
- odiseoteam/blog-bundle[v1.1.7, ..., v1.1.23] require monolog/monolog ~1.22 -> found monolog/monolog[1.22.0, ..., 1.26.0] but the package is fixed to 2.2.0 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
- Root composer.json requires odiseoteam/sylius-blog-plugin ^1.2 -> satisfiable by odiseoteam/sylius-blog-plugin[v1.2.0, v1.2.1, v1.2.2].
Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.

I tried to run the installation "--with-all-dependencies" but this totally broke my vendor.

Any help would be great!

Kind regards

non-existent parameter

Hello,

i've follow all the docs but i've an error :

You have requested a non-existent parameter "odiseo_blog.model.article.class".

My _sylius.yaml:

imports:

  • { resource: "@SyliusCoreBundle/Resources/config/app/config.yml" }
  • { resource: "@SyliusAdminBundle/Resources/config/app/config.yml" }
  • { resource: "@SyliusAdminApiBundle/Resources/config/app/config.yml" }
  • { resource: "@SyliusShopBundle/Resources/config/app/config.yml" }
  • { resource: "@OdiseoSyliusBlogPlugin/Resources/config/config.yml" }
  • { resource: "@BitBagSyliusCmsPlugin/Resources/config/config.yml" }

My bundles.php:

['all' => true], Symfony\Bundle\MonologBundle\MonologBundle::class => ['all' => true], Symfony\Bundle\SecurityBundle\SecurityBundle::class => ['all' => true], Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle::class => ['all' => true], Symfony\Bundle\TwigBundle\TwigBundle::class => ['all' => true], Doctrine\Bundle\DoctrineBundle\DoctrineBundle::class => ['all' => true], Doctrine\Bundle\DoctrineCacheBundle\DoctrineCacheBundle::class => ['all' => true], Sylius\Bundle\OrderBundle\SyliusOrderBundle::class => ['all' => true], Sylius\Bundle\MoneyBundle\SyliusMoneyBundle::class => ['all' => true], Sylius\Bundle\CurrencyBundle\SyliusCurrencyBundle::class => ['all' => true], Sylius\Bundle\LocaleBundle\SyliusLocaleBundle::class => ['all' => true], Sylius\Bundle\ProductBundle\SyliusProductBundle::class => ['all' => true], Sylius\Bundle\ChannelBundle\SyliusChannelBundle::class => ['all' => true], Sylius\Bundle\AttributeBundle\SyliusAttributeBundle::class => ['all' => true], Sylius\Bundle\TaxationBundle\SyliusTaxationBundle::class => ['all' => true], Sylius\Bundle\ShippingBundle\SyliusShippingBundle::class => ['all' => true], Sylius\Bundle\PaymentBundle\SyliusPaymentBundle::class => ['all' => true], Sylius\Bundle\MailerBundle\SyliusMailerBundle::class => ['all' => true], Sylius\Bundle\PromotionBundle\SyliusPromotionBundle::class => ['all' => true], Sylius\Bundle\AddressingBundle\SyliusAddressingBundle::class => ['all' => true], Sylius\Bundle\InventoryBundle\SyliusInventoryBundle::class => ['all' => true], Sylius\Bundle\TaxonomyBundle\SyliusTaxonomyBundle::class => ['all' => true], Sylius\Bundle\UserBundle\SyliusUserBundle::class => ['all' => true], Sylius\Bundle\CustomerBundle\SyliusCustomerBundle::class => ['all' => true], Sylius\Bundle\UiBundle\SyliusUiBundle::class => ['all' => true], Sylius\Bundle\ReviewBundle\SyliusReviewBundle::class => ['all' => true], Sylius\Bundle\CoreBundle\SyliusCoreBundle::class => ['all' => true], Sylius\Bundle\ResourceBundle\SyliusResourceBundle::class => ['all' => true], Sylius\Bundle\GridBundle\SyliusGridBundle::class => ['all' => true], winzou\Bundle\StateMachineBundle\winzouStateMachineBundle::class => ['all' => true], Sonata\CoreBundle\SonataCoreBundle::class => ['all' => true], Sonata\BlockBundle\SonataBlockBundle::class => ['all' => true], Sonata\IntlBundle\SonataIntlBundle::class => ['all' => true], Bazinga\Bundle\HateoasBundle\BazingaHateoasBundle::class => ['all' => true], JMS\SerializerBundle\JMSSerializerBundle::class => ['all' => true], FOS\RestBundle\FOSRestBundle::class => ['all' => true], Knp\Bundle\GaufretteBundle\KnpGaufretteBundle::class => ['all' => true], Knp\Bundle\MenuBundle\KnpMenuBundle::class => ['all' => true], Liip\ImagineBundle\LiipImagineBundle::class => ['all' => true], Payum\Bundle\PayumBundle\PayumBundle::class => ['all' => true], Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle::class => ['all' => true], WhiteOctober\PagerfantaBundle\WhiteOctoberPagerfantaBundle::class => ['all' => true], Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle::class => ['all' => true], Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle::class => ['all' => true], Sylius\Bundle\FixturesBundle\SyliusFixturesBundle::class => ['all' => true], Sylius\Bundle\PayumBundle\SyliusPayumBundle::class => ['all' => true], Sylius\Bundle\ThemeBundle\SyliusThemeBundle::class => ['all' => true], Sylius\Bundle\AdminBundle\SyliusAdminBundle::class => ['all' => true], Sylius\Bundle\ShopBundle\SyliusShopBundle::class => ['all' => true], FOS\OAuthServerBundle\FOSOAuthServerBundle::class => ['all' => true], Sylius\Bundle\AdminApiBundle\SyliusAdminApiBundle::class => ['all' => true], Symfony\Bundle\DebugBundle\DebugBundle::class => ['dev' => true, 'test' => true, 'test_cached' => true], Symfony\Bundle\WebProfilerBundle\WebProfilerBundle::class => ['dev' => true, 'test' => true, 'test_cached' => true], Symfony\Bundle\WebServerBundle\WebServerBundle::class => ['dev' => true, 'test' => true, 'test_cached' => true], Fidry\AliceDataFixtures\Bridge\Symfony\FidryAliceDataFixturesBundle::class => ['dev' => true, 'test' => true, 'test_cached' => true], Nelmio\Alice\Bridge\Symfony\NelmioAliceBundle::class => ['dev' => true, 'test' => true, 'test_cached' => true], FriendsOfBehat\SymfonyExtension\Bundle\FriendsOfBehatSymfonyExtensionBundle::class => ['test' => true, 'test_cached' => true], Sylius\Behat\Application\SyliusTestPlugin\SyliusTestPlugin::class => ['test' => true, 'test_cached' => true], Odiseo\BlogBundle\OdiseoBlogBundle::class => ['all' => true], FOS\CKEditorBundle\FOSCKEditorBundle::class => ['all' => true], SitemapPlugin\SitemapPlugin::class => ['all' => true], BitBag\SyliusCmsPlugin\BitBagSyliusCmsPlugin::class => ['all' => true], Odiseo\SyliusBlogPlugin\OdiseoSyliusBlogPlugin::class => ['all' => true], ];

Sylius Version : 1.4

Thx for any help.

Can't override article resource

Hi,

I try to override the article resource, but I get following error :
Neither the property "translations" nor one of the methods "translations()", "gettranslations()"/"istranslations()"/"hastranslations()" or "__call()" exist and have public access in class "Symfony\Component\Form\FormView"

It seems that ArticleTranslation is not managed as a resource by Sylius.

Removing comment also removes article associated with it

While exploring plugin I've found bug that when I remove the comment from article then the article itself is also being removed.

I've found out that it's because of this yml code block:

 manyToOne:
    article:
        targetEntity: Odiseo\BlogBundle\Model\ArticleInterface
        inversedBy: comments
        cascade: [ALL]
        joinColumn:
            name: article_id
            referencedColumnName: id
            onDelete: CASCADE

The bug caused by this cascade: cascade: [ALL] and if it's changed to cascade: [persist] then everything works fine.

This is the file and the line
vendor/odiseoteam/blog-bundle/src/Resources/config/doctrine/model/ArticleComment.orm.yml:38

Can you fix Fatal error: Type of $mappingFormat must be string?

Hello,

can you fix Fatal error: Type of Odiseo\BlogBundle\OdiseoBlogBundle::$mappingFormat must be string (as in class Sylius\Bundle\ResourceBundle\AbstractResourceBundle) in C:\xampp\htdocs\sudekusa-shop\vendor\odiseoteam\blog-bundle\src\OdiseoBlog Bundle.php on line 35

Problem is on php 8.0.19
sylius\sylius: 1.11.13

...
final class OdiseoBlogBundle extends AbstractResourceBundle
{
protected $mappingFormat = ResourceBundleInterface::MAPPING_YAML;
to
protected string $mappingFormat = ResourceBundleInterface::MAPPING_YAML;
...

Thank you

Call to a member function get() on null ($this->translations)

Hello
I extended class ArticleCategory and it works, but if I trying to add new article got error "Call to a member function get() on null".
This $this->translations, initialised in constructor (TranslatableTrait), return NULL. It's weird.

public function __construct()
    {
        $this->translations = new ArrayCollection();
    }

My model:

declare(strict_types=1);

namespace App\Entity\Blog;

use Doctrine\ORM\Mapping as ORM;
use Odiseo\BlogBundle\Model\ArticleCategory as BaseArticleCategory;
use Odiseo\BlogBundle\Model\ArticleCategoryTranslation;
use Odiseo\BlogBundle\Model\ArticleCategoryInterface;

/**
 * @ORM\Entity
 * @ORM\Table(name="odiseo_blog_article_category")
 */
class ArticleCategory extends BaseArticleCategory implements ArticleCategoryInterface
{
    /**
     * @ORM\Column(type="integer", nullable=true)
     */
    private $wp_id;

    /**
     * @ORM\ManyToOne(targetEntity=ArticleCategory::class)
	 * @ORM\JoinColumn(onDelete="CASCADE")
     */
    private $parent;

    public function getWpId(): ?int
    {
        return $this->wp_id;
    }

    public function setWpId(int $wp_id): self
    {
        $this->wp_id = $wp_id;

        return $this;
    }

    public function getParent(): ?self
    {
        return $this->parent;
    }

    public function setParent(?self $parent): self
    {
        $this->parent = $parent;

        return $this;
    }
	
	protected function createTranslation(): ArticleCategoryTranslation
    {
        return new ArticleCategoryTranslation();
    }
}

odiseo_blog.yaml

imports:    
    - { resource: "@OdiseoSyliusBlogPlugin/Resources/config/config.yaml" }

odiseo_blog:
    resources:
        article_category:
            classes:
                model: App\Entity\Blog\ArticleCategory

2021-12-16_00-24-55

Thanks in advance for any help!

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.