Skip to content

Instantly share code, notes, and snippets.

View bdunogier's full-sized avatar

Bertrand Dunogier bdunogier

View GitHub Profile
@bdunogier
bdunogier / Blog post with customized fields.md
Last active July 7, 2019 19:48
eZ Platform GraphQL prototype
{
  content (id: 87) {
    fields {
      fieldDefIdentifier
      value {
        ... on TextLineFieldValue {
          value
        }
 ... on RichTextFieldValue {
<?xml version="1.0" encoding="UTF-8"?>
<ErrorMessage media-type="application/vnd.ez.api.ErrorMessage+xml">
<errorCode>500</errorCode>
<errorMessage>Internal Server Error</errorMessage>
<errorDescription>Warning: trim() expects parameter 1 to be string, array given</errorDescription>
<trace>#0 [internal function]: Symfony\Component\Debug\ErrorHandler-&gt;handleError(2, 'trim() expects ...', '/Users/bdunogie...', 107, Array)
#1 /Users/bdunogier/ezplatform/vendor/tedivm/stash/src/Stash/Pool.php(107): trim(Array, '/')
#2 /Users/bdunogier/ezplatform/vendor/tedivm/stash-bundle/Service/CacheService.php(62): Stash\Pool-&gt;getItem(Array)
#3 /Users/bdunogier/ezplatform/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/Persistence/Cache/CacheServiceDecorator.php(60): Tedivm\StashBundle\Service\CacheService-&gt;getItem(Array)
#4 /Users/bdunogier/ezplatform/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/Persistence/Cache/UserHandler.php(196): eZ\Publish\Core\Persistence\Cache\CacheServiceDecorator-&gt;getItem('use
@bdunogier
bdunogier / release_process.md
Created January 20, 2016 22:10
Wallabag release process doc

Definition

A release is mostly a git tag of http://github.com/wallabag/wallabag, following semantic versioning. The last release at the time of writing is 2.0.0-alpha.2, from the v2 branch.

Creating a release tag

In order to create a release tag, it is usually easier to create a release branch:

<h2>Welcome to eZ Platform</h2>
<p>Congratulations, you just installed eZ Platform. eZ Platform is the new generation
Content Management Platform from eZ Systems and the eZ Community replacing eZ Publish, our previous software.</p>
<h3>Need some guidance?</h3>
<p>Check out the following resources:</p>
<h4><a href="https://doc.ez.no/display/USERGUIDE/eZ+User+Manual">User Manual</a> for eZ Platform (and eZ Studio)</h4>
<h4><a href="https://doc.ez.no/display/EZP/eZ+Platform+Developer+Documentation">Technical doc</a> for eZ Platform (and eZ Publish Platform new stack)</h4>
<h4><a href="https://doc.ez.no/display/EZP/Beginner+Tutorial">eZ Platform</a> developer tutorial</h4>
<h4><a href="https://doc.ez.no/display/MAIN/Transitioning+from+eZ+Publish+to+eZ+Platform+and+eZ+Studio%3A+Feature+Comparison">Comparison guide</a> between eZ Platform and eZ Publish Platform</h4>
<h3>Contribute to the project?</h3>

Platform interface/API idea: ContentType/Field mapping for extensions.

My extension does stuff on different content types / fields, and I want my users to be able to easily map their content structure to my needs.

In an extension, instead of getting content types using the ContentTypeService, one could use this other API. It would return something that looks like the expected content type, and it would map the fields.

Note that this is I think very close from what Kaliop's Object Forwarder does.

@bdunogier
bdunogier / GenerateAbsoluteLocationUriCommand.php
Created December 2, 2015 16:51
How to generate an absolute URI from a Location with eZ Platform
<?php
/**
* @license For full copyright and license information view LICENSE file distributed with this source code.
*/
namespace BD\SandboxBundle\Command;
use eZ\Publish\Core\MVC\Symfony\Routing\RouteReference;
use eZ\Publish\Core\MVC\Symfony\SiteAccess;
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Input\InputInterface;
ezpublish:
siteaccess:
list:
- %default_siteaccess
groups:
default_group: [%default_siteaccess]
default_siteaccess: %default_siteaccess
match:
URIElement: 1
@bdunogier
bdunogier / gist:8b3bfcd4fdc49e7c0dc2
Created October 15, 2015 16:04
Testing application exception handling with Behat
Feature: Handling of Unauthorized repository exceptions
Scenario: When a Repository UnauthorizedException is throw, anonymous users are shown the login screen # vendor/ezsystems/ezpublish-kernel/eZ/Bundle/EzPublishCoreBundle/Features/Exception/unauthorized_login_form.feature:2
Given that I am not logged in # eZ\Bundle\EzPublishCoreBundle\Features\Context\ExceptionContext::iAmNotLoggedIn()
When a repository UnauthorizedException is thrown during an HTTP request # eZ\Bundle\EzPublishCoreBundle\Features\Context\ExceptionContext::anExceptionIsThrownDuringAnHTTPRequest()
Then the login form is shown # eZ\Bundle\EzPublishCoreBundle\Features\Context\ExceptionContext::theLoginFormIsShown()
Scenario: When a Repository UnauthorizedException is throw, authenticated users are shown the exception # vendor/ezsystems/ezpublish-kernel/eZ/B
@bdunogier
bdunogier / 1_before.php
Last active October 12, 2015 07:21
Custom eZ Platform actions, before and after
<?php
class DemoController
{
public function showBlogPostAction(Location $location, $viewType, $layout = false, array $params = array())
{
// We need the author, whatever the view type is.
$author = $this->userService->loadUser($location->getContentInfo()->ownerId);
// TODO once the keyword service is available, load the number of keyword for each keyword
// Delegate view rendering to the original ViewController
// (makes it possible to continue using defined template rules)
@bdunogier
bdunogier / help.md
Created October 1, 2015 10:34
Symfony env depending on a cookie

Add this URL as a bookmark, with 'dev' replaced with the environment to switch to. Repeat for each env.

javascript:(/** @version 0.5.2 */function() {document.cookie='env=dev;path=/;';})()