New! Checkout our new Forums homepage! Follow the latest activity in eZ Publish Forums on Share.ez.no, Projects.ez.no and StackOverflow.com


@ezpublishlegacy
ezpublishlegacy pushed to master in ezpublishlegacy/repository-forms
  • @webhdx 01560f2
    EZP-28939: Internal Server Error when saving unpublished Draft (#227)
Mar 23, 2018
03/23/2018 12:38 pm   eZPublishLegacy @ GitHub   Mirror   Link   @12
@ezpublishlegacy
ezpublishlegacy pushed to master in ezpublishlegacy/phpunit
Mar 23, 2018
03/23/2018 12:36 pm   eZPublishLegacy @ GitHub   Mirror   Link   @6
@ezpublishlegacy
ezpublishlegacy pushed to master in ezpublishlegacy/mugo_varnish
Mar 23, 2018
03/23/2018 12:29 pm   eZPublishLegacy @ GitHub   Mirror   Link   @6
@ezpublishlegacy
ezpublishlegacy pushed to master in ezpublishlegacy/ezplatform-demo
  • @damianz5 f6092ba
    DEMO-113: [Product] - Card View (#82)
Mar 23, 2018
03/23/2018 12:13 pm   eZPublishLegacy @ GitHub   Mirror   Link   @6
@ezecosystem
ezecosystem pushed to master in ezecosystem/SyliusDemo
Mar 23, 2018
03/23/2018 12:09 pm   eZecosystem @ GitHub   Mirror   Link   @4
@ezecosystem
ezecosystem pushed to master in ezecosystem/repository-forms
  • @webhdx 01560f2
    EZP-28939: Internal Server Error when saving unpublished Draft (#227)
Mar 23, 2018
03/23/2018 12:08 pm   eZecosystem @ GitHub   Mirror   Link   @10
@ezecosystem
ezecosystem pushed to master in ezecosystem/ezpublish-kernel
Mar 23, 2018
03/23/2018 12:00 pm   eZecosystem @ GitHub   Mirror   Link   @4
@ezecosystem
ezecosystem pushed to master in ezecosystem/ezplatform-demo
  • @damianz5 f6092ba
    DEMO-113: [Product] - Card View (#82)
Mar 23, 2018
03/23/2018 11:59 am   eZecosystem @ GitHub   Mirror   Link   @4

In Symfony 4.1 we improved the Workflow component with lots of major and minor features. This blog post summarizes the most important ones.

New PlantUML dumper

Contributed by
Sébastien Morel
in #24705.

Workflows can already be exported to the well-known DOT format and then transformed into image files. In Symfony 4.1 we added support for other popular format called PlantUML. So now you can choose the format that best suits you:

1
2
3
4
5
# traditional DOT-based dumping
$ bin/console workflow:dump my_workflow | dot -Tpng > my_workflow.png

# new PlantUML-based dumping
$ bin/console workflow:dump my_workflow --dump-format=puml | java -jar plantuml.jar -p > my_workflow.png

Removed constraints on transtion/place names

Contributed by
Grégoire Pineau
in #26079.

Previously the names of the workflow transitions and places could only contain the characters that matched this regular expression: [\w_-]. Now you can use any character in those names.

New WorkflowInterface and WorkflowSupportStrategyInterface interfaces

Contributed by
Hamza Amrouche
in #24751.

The Workflow class now implements the new WorkflowInterface. This interface contains the same methods of the existing class (getMarking(), can(), apply(), getEnabledTransitions(), getName(), getDefinition() and getMarkingStore()) so you don't have to make any change in your code.

In addition, a new WorkflowSupportStrategyInterface has been created to replace the now deprecated SupportStrategyInterface. The new interface only contains the supports() method, so again you don't need to change anything in your code except the interface class.

Added transition blockers

Contributed by
Grégoire Pineau
in #26076.

The new transition blockers defined via the TransitionBlocker class allow you to give more information about why a transition couldn't happen in the workflow:

1
2
3
$event->addTransitionBlocker(
    new TransitionBlocker('You can not publish this article because it\'s too late. Try again tomorrow morning.')
);

And then you can access to this information in PHP code and Twig templates too:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
<h2>Why you can't transition?</h2>
<ul>
    {% for transition in workflow_all_transitions(article) %}
        {% if not workflow_can(article, transition.name) %}
            <li>
                <strong>{{ transition.name }}</strong>:
                <ul>
                {% for blocker in workflow_build_transition_blocker_list(article, transition.name) %}
                    <li>
                        {{ blocker.message }}
                        {% if blocker.parameters.expression is defined %}
                            <code>{{ blocker.parameters.expression }}</code>
                        {% endif %}
                    </li>
                {% endfor %}
                </ul>
            </li>
        {% endif %}
    {% endfor %}
</ul>

Allow to store metadata

Contributed by
Grégoire Pineau
in #26092.

You can now store arbitrary metadata in places, transitions and workflows using the metadata option:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
# config/packages/workflow.yaml
framework:
    workflows:
        my_workflow:
            supports:
                - App\Entity\BlogPost
            metadata:
                some_key: 'some_value'
                other_key: 'other_value'
            # ...
            places:
                some_place:
                    metadata:
                        some_key: 'some_value'
            # ...
            transitions:
                some_transition:
                    metadata:
                        some_key: 'some_value'

Metadata is stored using objects that implement MetadataStoreInterface and it can be obtained with the getMetadata() method:

1
2
3
4
5
6
public function onReview(Event $event) {
    $metadataStore = $event->getWorkflow()->getMetadataStore();
    foreach ($event->getTransition()->getTos() as $place) {
        $this->flashbag->add('info', $metadataStore->getPlaceMetadata($place)->get('some_key'));
    }
}

In Twig templates you can use the new workflow_metadata() function:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
<strong>Current place(s)</strong>
<ul>
{% for place in workflow_marked_places(article) %}
    <li>
        {{ place }}:
        <code>{{ workflow_metadata(article, 'title', place) ?: 'n-a'}}</code>
    </li>
{% endfor %}
</ul>

<strong>Enabled transition(s)</strong>
<ul>
{% for transition in workflow_transitions(article) %}
    <li>
        {{ transition.name }}:
        <code>{{ workflow_metadata(article, 'title', transition) ?: 'n-a'}}</code>
    </li>
{% endfor %}
</ul>

Added a new TransitionException class

Contributed by
Andrew Tchircoff
in #26587.

When a transition cannot be applied for the workflow, a new Symfony\Component\Workflow\Exception\TransitionException is thrown instead of the previous generic LogicException.


Be trained by Symfony experts - 2018-04-3 Paris - 2018-04-3 Paris - 2018-04-3 Paris
03/23/2018 09:50 am   Symfony Blog   Mirror   Link   @10
@ezpublishlegacy
ezpublishlegacy pushed to master in ezpublishlegacy/mugo_varnish
  • @pkamps 97b8cae
    Allow to purge varnish cache matching the HTTP host value - important…
Mar 22, 2018
03/22/2018 12:31 pm   eZPublishLegacy @ GitHub   Mirror   Link   @8
@ezpublishlegacy
ezpublishlegacy pushed to master in ezpublishlegacy/ezstudio-demo
Mar 22, 2018
03/22/2018 12:21 pm   eZPublishLegacy @ GitHub   Mirror   Link   @10
@ezpublishlegacy
ezpublishlegacy pushed to master in ezpublishlegacy/ezstudio
Mar 22, 2018
03/22/2018 12:20 pm   eZPublishLegacy @ GitHub   Mirror   Link   @8
@ezpublishlegacy
ezpublishlegacy pushed to master in ezpublishlegacy/EzPublishCoreExtraBundle
Mar 22, 2018
03/22/2018 12:18 pm   eZPublishLegacy @ GitHub   Mirror   Link   @4
@ezpublishlegacy
ezpublishlegacy pushed to master in ezpublishlegacy/ezpublish-event
  • @dennisxrow 4a0ef95
    Workaround for Argument 1 passed to eZPublishEventSearch::delete() mu…
Mar 22, 2018
03/22/2018 12:16 pm   eZPublishLegacy @ GitHub   Mirror   Link   @10
@ezpublishlegacy
ezpublishlegacy pushed to master in ezpublishlegacy/ezplatform-demo
Mar 22, 2018
03/22/2018 12:14 pm   eZPublishLegacy @ GitHub   Mirror   Link   @14
@ezpublishlegacy
ezpublishlegacy pushed to master in ezpublishlegacy/ezplatform
Mar 22, 2018
03/22/2018 12:14 pm   eZPublishLegacy @ GitHub   Mirror   Link   @8
@ezecosystem
ezecosystem pushed to master in ezecosystem/SyliusDemo
Mar 22, 2018
03/22/2018 12:10 pm   eZecosystem @ GitHub   Mirror   Link   @8
@ezecosystem
ezecosystem pushed to master in ezecosystem/Sylius
Mar 22, 2018
03/22/2018 12:10 pm   eZecosystem @ GitHub   Mirror   Link   @6
@ezecosystem
ezecosystem pushed to master in ezecosystem/NetgenAdminUIBundle
Mar 22, 2018
03/22/2018 12:06 pm   eZecosystem @ GitHub   Mirror   Link   @6

For most content-based websites, success comes down to a trifecta of critical metrics: traffic, engagement, and revenue. These success metrics can also be expressed as a conversion path: you drive traffic to your site via content and marketing strategies that engage your audience, and this converts to revenue via ads, sponsored content, paid subscriptions, or otherwise.

03/22/2018 12:06 pm   Mugo Web Blog   Mirror   Link   @12
@ezecosystem
ezecosystem pushed to master in ezecosystem/ezstudio-demo
Mar 22, 2018
03/22/2018 12:03 pm   eZecosystem @ GitHub   Mirror   Link   @8
@ezecosystem
ezecosystem pushed to master in ezecosystem/ezstudio
Mar 22, 2018
03/22/2018 12:02 pm   eZecosystem @ GitHub   Mirror   Link   @8
@ezecosystem
ezecosystem pushed to master in ezecosystem/ezplatform-demo
Mar 22, 2018
03/22/2018 12:00 pm   eZecosystem @ GitHub   Mirror   Link   @8
@ezecosystem
ezecosystem pushed to master in ezecosystem/ezplatform
Mar 22, 2018
03/22/2018 12:00 pm   eZecosystem @ GitHub   Mirror   Link   @8
@ezecosystem
ezecosystem pushed to master in ezecosystem/EzCoreExtraBundle
Mar 22, 2018
03/22/2018 11:59 am   eZecosystem @ GitHub   Mirror   Link   @6
03/22/2018 10:58 am   eZ Publish Youtube   Mirror   Link   @8

Et un peu hors-sujet :

(En plus du flux RSS global, les billets veille et uniquement ceux là sont listés dans le flux RSS veille)

03/22/2018 06:12 am   pwet.fr/blog   Mirror   Link   @8

Contributed by
Nicolas Grekas
in #26518.

The Symfony Routing component allows to define requirements and default values for route placeholders using the requirements and defaults options respectively.

For example, in the following route defined with PHP annotations, the page placeholder is restricted to only accept integers and its default value is 1:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
use Symfony\Component\Routing\Annotation\Route;

class BlogController extends Controller
{
    /**
     * @Route("/blog/{page}", name="blog_list", requirements={"page"="\d+"}, defaults={"page"="1"})
     */
    public function list($page)
    {
        // ...
    }
}

This route config is a bit verbose for simple conditions. That's why in Symfony 4.1 you can inline the route requirements and default values in the placeholders. The previous example in Symfony 4.1 can look like this:

1
2
3
4
5
6
7
/**
 * @Route("/blog/{page<\d+>?1}", name="blog_list")
 */
public function list($page)
{
    // ...
}

The new syntax is {placeholder-name<requirements>?defaults}, every part of it is optional and it works in all config formats (annotations, YAML and XML):

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
blog_list:
    # no requirements and no default value
    path: /blog/{page}
    # with requirements but no default value
    path: /blog/{page<\d+>}
    # no requirements but with a default value
    path: /blog/{page?1}
    # no requirements but with default value = null
    path: /blog/{page?}
    # with requirements and default value = null
    path: /blog/{page<.*>?}

You can inline the config for multiple placeholders in the same route, but if there are lots of placeholders or the conditions are complex, the resulting config may be less readable and you should probably revert to the previous syntax:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
// this config may be too complex to inline it:

/** @Route("/{_locale<en|es|fr>?en}/blog/{category<news|releases|security>?news}/{page<\d+>?1}", name="blog_list") */
public function list($page) { }

// in this case it may be better to keep using the traditional syntax

/**
 * @Route("/{_locale}/blog/{category}/{page}", name="blog_list",
 *   "requirements"={"_locale": "en|es|fr", "category": "news|releases|security", "page": "\d"},
 *   "defaults"={"_locale": "en", "category": "news", "page": "1"}
 * )
 */
public function list($page) { }

Be trained by Symfony experts - 2018-04-3 Paris - 2018-04-3 Paris - 2018-04-3 Paris
03/22/2018 02:31 am   Symfony Blog   Mirror   Link   @8