jorrit

jorrit

Member Since 10 years ago

nCode, Breda, The Netherlands

Experience Points
11
follower
Lessons Completed
19
follow
Lessons Completed
468
stars
Best Reply Awards
300
repos

136 contributions in the last year

Pinned
⚡ A small, simple, very easy wrapper around the require.js optimizer to work with gulp.js
⚡ Display tables traditionally on wide screens and with headers prepended to each data cell on narrow screens.
⚡ Adds a clone action to Sonata Admin.
Activity
Oct
14
2 days ago
pull request

jorrit pull request expressjs/compression

jorrit
jorrit

deps: [email protected]

Other Express-related packages like body-parser and raw-body require [email protected] so upgrading this dependency in compression saves a copy of bytes on all installations that combine express and compression.

Activity icon
created branch

jorrit in jorrit/compression create branch bytes

createdAt 1 day ago
Activity icon
fork

jorrit forked expressjs/compression

⚡ Node.js compression middleware
jorrit MIT License Updated
fork time in 1 day ago
Oct
13
3 days ago
Activity icon
issue

jorrit issue comment ChilliCream/hotchocolate

jorrit
jorrit

Strawberry Shake request context data.

Transport Context Data

In some cases, we want to pass in extra information with a GraphQL request that can be used in the client middleware to enrich the request.

Since Strawberry Shake supports multiple transports we want to do it in a way that does not bind this to a specific transport technology.

Context Directives

This is where context directives come in that we can use on operation definitions.

Let's say we have the following query request where we want to pass along some extra context-data that we can use in the request pipeline to either enrich the transport or even to enrich local processing.

query GetSessions {
  sessions {
    nodes {
      ... SessionInfo
    }
  }
}

fragment SessionInfo on Session {
  id
  title
}

In our example, we want to pass in an object that shall be used to create request headers when this request is executed over HTTP.

For this we will introduce a directive and an input type in the schema.extensions.graphql.

directive @myCustomHeaders(input: MyCustomHeaders!) on QUERY

input MyCustomHeaders {
    someProp: String!
}

This new directive can now be used on queries and allows us to tell the Strawberry Shake compiler to generate the C# request in a way that we need to pass in the extra information.

query GetSessions($headers: MyCustomHeaders!) @myCustomHeaders(input: $headers) {
  sessions {
    nodes {
      ... SessionInfo
    }
  }
}

fragment SessionInfo on Session {
  id
  title
}

This will result in the generation of a required new parameter on the client.

await conferenceClient.GetSessions.ExecuteAsync(new MyCustomHeaders { SomeProp = "Hello" });

This proposal is dependant on work to make the middleware accessible by the user.

jorrit
jorrit

I have this utility class:

using StrawberryShake;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;

#nullable enable

namespace ANWBReizen.Travelhome.API.ApiClients.Product.Client
{
    public static class LanguageOperation
    {
        private static readonly AsyncLocal<string> Store = new AsyncLocal<string>();
        private static readonly string[] Languages = new[] { "en", "nl" };
        public static string? Value => Store.Value;

        public static async Task<IOperationResult<TResultData>> Run<TResultData>(string language, Func<CancellationToken, Task<IOperationResult<TResultData>>> implementation)
            where TResultData : class
        {
            Store.Value = language;
            return await implementation(CancellationToken.None);
        }

        public static async Task<IDictionary<string, TResultData>> RunAll<TResultData>(Func<CancellationToken, Task<IOperationResult<TResultData>>> implementation)
            where TResultData : class
        {
            var tasks = Languages.ToDictionary(lang => lang, lang => Run(lang, implementation));

            await Task.WhenAll(tasks.Values);

            return tasks.ToDictionary(t => t.Key, t =>
            {
                var result = t.Value.Result;
                result.EnsureNoErrors();
                if (result.Data == null)
                {
                    throw new Exception("No data");
                }

                return result.Data;
            });
        }
    }
}

In Startup.cs I have:

            var builder = services.AddProductApi()
                .ConfigureHttpClient((sp, client) =>
                {
                    var options = sp.GetRequiredService<IOptions<ProductOptions>>();
                    client.BaseAddress = options.Value.Url;
                    client.Timeout = timeout;
                    var language = LanguageOperation.Value;
                    if (language != null)
                    {
                        client.DefaultRequestHeaders.Add("Accept-Language", language);
                    }
                });

I call it like this:

var results = await LanguageOperation.RunAll(_apiClient.VehicleFacets.ExecuteAsync);
Oct
12
4 days ago
Activity icon
issue

jorrit issue comment react-hook-form/react-hook-form

jorrit
jorrit

[Feature]: Support forms inside shadow roots

Version Number

7.17.2

Codesandbox/Expo snack

https://codesandbox.io/s/react-hook-form-bug-in-shadow-root-dib0m

Steps to reproduce

  1. Go to https://codesandbox.io/s/react-hook-form-bug-in-shadow-root-dib0m
  2. Click on any of the first 2 radio buttons in the section 'With shadow root'
  3. The radio button is not selected.

Expected behaviour

The radio buttons should be selectable.

What browsers are you seeing the problem on?

No response

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
jorrit
jorrit

You're welcome, it was an interesting investigation.

I noticed that document.contains is also used in live.ts. I don't know for what purpose that code is used, but I can imagine it also causes bugs in Shadow DOM roots.

Anyway, many thanks for react-hook-form and your time!

Activity icon
issue

jorrit issue comment react-hook-form/react-hook-form

jorrit
jorrit

[Bug]: radiobuttons not functional when hosted in shadow root

Version Number

7.17.2

Codesandbox/Expo snack

https://codesandbox.io/s/react-hook-form-bug-in-shadow-root-dib0m

Steps to reproduce

  1. Go to https://codesandbox.io/s/react-hook-form-bug-in-shadow-root-dib0m
  2. Click on any of the first 2 radio buttons in the section 'With shadow root'
  3. The radio button is not selected.

Expected behaviour

The radio buttons should be selectable.

What browsers are you seeing the problem on?

No response

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
jorrit
jorrit

I am convinced that the issue lies with the use of document.contains(), which causes the refs of the radio field to contain only the last input.

Maybe this guide can provide a solution:

https://terodox.tech/how-to-tell-if-an-element-is-in-the-dom-including-the-shadow-dom/

Activity icon
issue

jorrit issue react-hook-form/react-hook-form

jorrit
jorrit

[Bug]: radiobuttons not functional when hosted in shadow root

Version Number

7.17.2

Codesandbox/Expo snack

https://codesandbox.io/s/react-hook-form-bug-in-shadow-root-dib0m

Steps to reproduce

  1. Go to https://codesandbox.io/s/react-hook-form-bug-in-shadow-root-dib0m
  2. Click on any of the first 2 radio buttons in the section 'With shadow root'
  3. The radio button is not selected.

Expected behaviour

The radio buttons should be selectable.

What browsers are you seeing the problem on?

No response

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
Oct
7
1 week ago
Activity icon
issue

jorrit issue comment sonata-project/SonataAdminBundle

jorrit
jorrit

Top menu items show HTML

Environment

Sonata packages

show

sonata-project/admin-bundle              3.105.2 4.0.1  The missing Symfony Admin Generator
sonata-project/block-bundle              3.23.2  4.7.0  Symfony SonataBlockBundle
sonata-project/cache                     2.2.0   2.2.0  Cache library
sonata-project/doctrine-extensions       1.13.1  1.14.0 Doctrine2 behavioral extensions
sonata-project/doctrine-orm-admin-bundle 3.35.0  4.0.0  Integrate Doctrine ORM into the SonataAdminBundle
sonata-project/exporter                  2.8.0   2.8.0  Lightweight Exporter library
sonata-project/form-extensions           1.9.0   1.11.0 Symfony form extensions
sonata-project/formatter-bundle          4.6.1   4.6.1  Symfony SonataFormatterBundle
sonata-project/intl-bundle               2.10.2  2.10.2 Symfony SonataIntlBundle
sonata-project/media-bundle              3.33.1  3.34.0 Symfony SonataMediaBundle
sonata-project/translation-bundle        2.8.1   2.9.0  SonataTranslationBundle
sonata-project/twig-extensions           1.9.0   1.9.0  Sonata twig extensions

Symfony packages

show

symfony/asset                      v5.2.12 v5.3.4  Manages URL generation and versioning of web assets such as CSS stylesheets, JavaScript files and image files
symfony/browser-kit                v5.3.4  v5.3.4  Simulates the behavior of a web browser, allowing you to make requests, click on links and submit forms programmatically
symfony/cache                      v5.3.8  v5.3.8  Provides an extended PSR-6, PSR-16 (and tags) implementation
symfony/cache-contracts            v2.4.0  v2.4.0  Generic abstractions related to caching
symfony/config                     v4.4.30 v5.3.4  Helps you find, load, combine, autofill and validate configuration values of any kind
symfony/console                    v4.4.30 v5.3.7  Eases the creation of beautiful and testable command line interfaces
symfony/css-selector               v5.3.4  v5.3.4  Converts CSS selectors to XPath expressions
symfony/debug                      v4.4.31 v4.4.31 Provides tools to ease debugging PHP code
symfony/debug-bundle               v5.1.11 v5.3.4  Provides a tight integration of the Symfony Debug component into the Symfony full-stack framework
symfony/dependency-injection       v4.4.31 v5.3.8  Allows you to standardize and centralize the way objects are constructed in your application
symfony/deprecation-contracts      v2.4.0  v2.4.0  A generic function and convention to trigger deprecation notices
symfony/doctrine-bridge            v4.4.31 v5.3.8  Provides integration for Doctrine with various Symfony components
symfony/dom-crawler                v5.3.7  v5.3.7  Eases DOM navigation for HTML and XML documents
symfony/dotenv                     v5.3.8  v5.3.8  Registers environment variables from a .env file
symfony/error-handler              v4.4.30 v5.3.7  Provides tools to manage errors and ease debugging PHP code
symfony/event-dispatcher           v4.4.30 v5.3.7  Provides tools that allow your application components to communicate with each other by dispatching events and listening to them
symfony/event-dispatcher-contracts v1.1.9  v2.4.0  Generic abstractions related to dispatching event
symfony/expression-language        v5.3.7  v5.3.7  Provides an engine that can compile and evaluate expressions
symfony/filesystem                 v5.3.4  v5.3.4  Provides basic utilities for the filesystem
symfony/finder                     v5.3.7  v5.3.7  Finds files and directories via an intuitive fluent interface
symfony/flex                       v1.16.3 v1.16.3 Composer plugin for Symfony
symfony/form                       v4.4.31 v5.3.8  Allows to easily create, process and reuse HTML forms
symfony/framework-bundle           v4.4.31 v5.3.8  Provides a tight integration between Symfony components and the Symfony full-stack framework
symfony/http-client                v5.3.8  v5.3.8  Provides powerful methods to fetch HTTP resources synchronously or asynchronously
symfony/http-client-contracts      v2.4.0  v2.4.0  Generic abstractions related to HTTP clients
symfony/http-foundation            v4.4.30 v5.3.7  Defines an object-oriented layer for the HTTP specification
symfony/http-kernel                v4.4.32 v5.3.9  Provides a structured process for converting a Request into a Response
symfony/intl                       v5.3.8  v5.3.8  Provides a PHP replacement layer for the C intl extension that includes additional data from the ICU library
symfony/mailer                     v5.3.9  v5.3.9  Helps sending emails
symfony/maker-bundle               v1.34.0 v1.34.0 Symfony Maker helps you create empty commands, controllers, form classes, tests and more so you can forget about writing boilerplate code.
symfony/mime                       v5.3.8  v5.3.8  Allows manipulating MIME messages
symfony/monolog-bridge             v5.2.12 v5.3.7  Provides integration for Monolog with various Symfony components
symfony/monolog-bundle             v3.7.0  v3.7.0  Symfony MonologBundle
symfony/options-resolver           v4.4.30 v5.3.7  Provides an improved replacement for the array_replace PHP function
symfony/phpunit-bridge             v5.3.8  v5.3.8  Provides utilities for PHPUnit, especially user deprecation notices management
symfony/polyfill-php80             v1.23.1 v1.23.1 Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions
symfony/polyfill-php81             v1.23.0 v1.23.0 Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions
symfony/polyfill-uuid              v1.23.0 v1.23.0 Symfony polyfill for uuid functions
symfony/process                    v5.3.7  v5.3.7  Executes commands in sub-processes
symfony/property-access            v5.3.8  v5.3.8  Provides functions to read and write from/to an object or array using a simple string notation
symfony/property-info              v5.3.8  v5.3.8  Extracts information about PHP class' properties using metadata of popular sources
symfony/proxy-manager-bridge       v4.4.27 v5.3.4  Provides integration for ProxyManager with various Symfony components
symfony/routing                    v4.4.30 v5.3.7  Maps an HTTP request to a set of configuration variables
symfony/security-acl               v3.2.0  v3.2.0  Symfony Security Component - ACL (Access Control List)
symfony/security-bundle            v4.4.27 v5.3.8  Provides a tight integration of the Security component into the Symfony full-stack framework
symfony/security-core              v4.4.31 v5.3.8  Symfony Security Component - Core Library
symfony/security-csrf              v5.2.12 v5.3.4  Symfony Security Component - CSRF Library
symfony/security-guard             v4.4.27 v5.3.7  Symfony Security Component - Guard
symfony/security-http              v4.4.30 v5.3.8  Symfony Security Component - HTTP Integration
symfony/serializer                 v5.3.8  v5.3.8  Handles serializing and deserializing data structures, including object graphs, into array structures or other formats like XML and JSON.
symfony/service-contracts          v2.4.0  v2.4.0  Generic abstractions related to writing services
symfony/stopwatch                  v5.3.4  v5.3.4  Provides a way to profile code
symfony/string                     v5.3.7  v5.3.7  Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way
symfony/swiftmailer-bundle         v3.5.2  v3.5.2  Symfony SwiftmailerBundle
symfony/templating                 v5.3.7  v5.3.7  Provides all the tools needed to build any kind of template system
symfony/translation                v4.4.32 v5.3.9  Provides tools to internationalize your application
symfony/translation-contracts      v2.4.0  v2.4.0  Generic abstractions related to translation
symfony/twig-bridge                v4.4.27 v5.3.7  Provides integration for Twig with various Symfony components
symfony/twig-bundle                v4.4.30 v5.3.4  Provides a tight integration of Twig into the Symfony full-stack framework
symfony/validator                  v5.3.8  v5.3.8  Provides tools to validate values
symfony/var-dumper                 v5.3.8  v5.3.8  Provides mechanisms for walking through any arbitrary PHP variable
symfony/var-exporter               v5.3.8  v5.3.8  Allows exporting any serializable PHP data structure to plain PHP code
symfony/web-profiler-bundle        v5.0.11 v5.3.8  Symfony WebProfilerBundle
symfony/webpack-encore-bundle      v1.12.0 v1.12.0 Integration with your Symfony app & Webpack Encore!
symfony/yaml                       v5.3.6  v5.3.6  Loads and dumps YAML files

PHP version

PHP 7.4.13 (cli) (built: Nov 24 2020 12:43:30) ( NTS Visual C++ 2017 x64 )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with Zend OPcache v7.4.13, Copyright (c), by Zend Technologies
    with Xdebug v3.0.2, Copyright (c) 2002-2021, by Derick Rethans

Subject

Since the most recent Sonata Admin update (which included just #7521) my menu looks like this:

image

jorrit
jorrit

I tried it, and it fixes the problem with the menu HTML. Thanks!

Oct
6
1 week ago
Activity icon
issue

jorrit issue comment doctrine/orm

jorrit
jorrit

Remove possibility to extend the doctrine mapping xml schema with anything

Backport of #6943

jorrit
jorrit

Didn't this break the semantic versioning promise?

Activity icon
issue

jorrit issue sonata-project/SonataAdminBundle

jorrit
jorrit

Top menu items show HTML

Environment

Sonata packages

show

sonata-project/admin-bundle              3.105.2 4.0.1  The missing Symfony Admin Generator
sonata-project/block-bundle              3.23.2  4.7.0  Symfony SonataBlockBundle
sonata-project/cache                     2.2.0   2.2.0  Cache library
sonata-project/doctrine-extensions       1.13.1  1.14.0 Doctrine2 behavioral extensions
sonata-project/doctrine-orm-admin-bundle 3.35.0  4.0.0  Integrate Doctrine ORM into the SonataAdminBundle
sonata-project/exporter                  2.8.0   2.8.0  Lightweight Exporter library
sonata-project/form-extensions           1.9.0   1.11.0 Symfony form extensions
sonata-project/formatter-bundle          4.6.1   4.6.1  Symfony SonataFormatterBundle
sonata-project/intl-bundle               2.10.2  2.10.2 Symfony SonataIntlBundle
sonata-project/media-bundle              3.33.1  3.34.0 Symfony SonataMediaBundle
sonata-project/translation-bundle        2.8.1   2.9.0  SonataTranslationBundle
sonata-project/twig-extensions           1.9.0   1.9.0  Sonata twig extensions

Symfony packages

show

symfony/asset                      v5.2.12 v5.3.4  Manages URL generation and versioning of web assets such as CSS stylesheets, JavaScript files and image files
symfony/browser-kit                v5.3.4  v5.3.4  Simulates the behavior of a web browser, allowing you to make requests, click on links and submit forms programmatically
symfony/cache                      v5.3.8  v5.3.8  Provides an extended PSR-6, PSR-16 (and tags) implementation
symfony/cache-contracts            v2.4.0  v2.4.0  Generic abstractions related to caching
symfony/config                     v4.4.30 v5.3.4  Helps you find, load, combine, autofill and validate configuration values of any kind
symfony/console                    v4.4.30 v5.3.7  Eases the creation of beautiful and testable command line interfaces
symfony/css-selector               v5.3.4  v5.3.4  Converts CSS selectors to XPath expressions
symfony/debug                      v4.4.31 v4.4.31 Provides tools to ease debugging PHP code
symfony/debug-bundle               v5.1.11 v5.3.4  Provides a tight integration of the Symfony Debug component into the Symfony full-stack framework
symfony/dependency-injection       v4.4.31 v5.3.8  Allows you to standardize and centralize the way objects are constructed in your application
symfony/deprecation-contracts      v2.4.0  v2.4.0  A generic function and convention to trigger deprecation notices
symfony/doctrine-bridge            v4.4.31 v5.3.8  Provides integration for Doctrine with various Symfony components
symfony/dom-crawler                v5.3.7  v5.3.7  Eases DOM navigation for HTML and XML documents
symfony/dotenv                     v5.3.8  v5.3.8  Registers environment variables from a .env file
symfony/error-handler              v4.4.30 v5.3.7  Provides tools to manage errors and ease debugging PHP code
symfony/event-dispatcher           v4.4.30 v5.3.7  Provides tools that allow your application components to communicate with each other by dispatching events and listening to them
symfony/event-dispatcher-contracts v1.1.9  v2.4.0  Generic abstractions related to dispatching event
symfony/expression-language        v5.3.7  v5.3.7  Provides an engine that can compile and evaluate expressions
symfony/filesystem                 v5.3.4  v5.3.4  Provides basic utilities for the filesystem
symfony/finder                     v5.3.7  v5.3.7  Finds files and directories via an intuitive fluent interface
symfony/flex                       v1.16.3 v1.16.3 Composer plugin for Symfony
symfony/form                       v4.4.31 v5.3.8  Allows to easily create, process and reuse HTML forms
symfony/framework-bundle           v4.4.31 v5.3.8  Provides a tight integration between Symfony components and the Symfony full-stack framework
symfony/http-client                v5.3.8  v5.3.8  Provides powerful methods to fetch HTTP resources synchronously or asynchronously
symfony/http-client-contracts      v2.4.0  v2.4.0  Generic abstractions related to HTTP clients
symfony/http-foundation            v4.4.30 v5.3.7  Defines an object-oriented layer for the HTTP specification
symfony/http-kernel                v4.4.32 v5.3.9  Provides a structured process for converting a Request into a Response
symfony/intl                       v5.3.8  v5.3.8  Provides a PHP replacement layer for the C intl extension that includes additional data from the ICU library
symfony/mailer                     v5.3.9  v5.3.9  Helps sending emails
symfony/maker-bundle               v1.34.0 v1.34.0 Symfony Maker helps you create empty commands, controllers, form classes, tests and more so you can forget about writing boilerplate code.
symfony/mime                       v5.3.8  v5.3.8  Allows manipulating MIME messages
symfony/monolog-bridge             v5.2.12 v5.3.7  Provides integration for Monolog with various Symfony components
symfony/monolog-bundle             v3.7.0  v3.7.0  Symfony MonologBundle
symfony/options-resolver           v4.4.30 v5.3.7  Provides an improved replacement for the array_replace PHP function
symfony/phpunit-bridge             v5.3.8  v5.3.8  Provides utilities for PHPUnit, especially user deprecation notices management
symfony/polyfill-php80             v1.23.1 v1.23.1 Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions
symfony/polyfill-php81             v1.23.0 v1.23.0 Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions
symfony/polyfill-uuid              v1.23.0 v1.23.0 Symfony polyfill for uuid functions
symfony/process                    v5.3.7  v5.3.7  Executes commands in sub-processes
symfony/property-access            v5.3.8  v5.3.8  Provides functions to read and write from/to an object or array using a simple string notation
symfony/property-info              v5.3.8  v5.3.8  Extracts information about PHP class' properties using metadata of popular sources
symfony/proxy-manager-bridge       v4.4.27 v5.3.4  Provides integration for ProxyManager with various Symfony components
symfony/routing                    v4.4.30 v5.3.7  Maps an HTTP request to a set of configuration variables
symfony/security-acl               v3.2.0  v3.2.0  Symfony Security Component - ACL (Access Control List)
symfony/security-bundle            v4.4.27 v5.3.8  Provides a tight integration of the Security component into the Symfony full-stack framework
symfony/security-core              v4.4.31 v5.3.8  Symfony Security Component - Core Library
symfony/security-csrf              v5.2.12 v5.3.4  Symfony Security Component - CSRF Library
symfony/security-guard             v4.4.27 v5.3.7  Symfony Security Component - Guard
symfony/security-http              v4.4.30 v5.3.8  Symfony Security Component - HTTP Integration
symfony/serializer                 v5.3.8  v5.3.8  Handles serializing and deserializing data structures, including object graphs, into array structures or other formats like XML and JSON.
symfony/service-contracts          v2.4.0  v2.4.0  Generic abstractions related to writing services
symfony/stopwatch                  v5.3.4  v5.3.4  Provides a way to profile code
symfony/string                     v5.3.7  v5.3.7  Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way
symfony/swiftmailer-bundle         v3.5.2  v3.5.2  Symfony SwiftmailerBundle
symfony/templating                 v5.3.7  v5.3.7  Provides all the tools needed to build any kind of template system
symfony/translation                v4.4.32 v5.3.9  Provides tools to internationalize your application
symfony/translation-contracts      v2.4.0  v2.4.0  Generic abstractions related to translation
symfony/twig-bridge                v4.4.27 v5.3.7  Provides integration for Twig with various Symfony components
symfony/twig-bundle                v4.4.30 v5.3.4  Provides a tight integration of Twig into the Symfony full-stack framework
symfony/validator                  v5.3.8  v5.3.8  Provides tools to validate values
symfony/var-dumper                 v5.3.8  v5.3.8  Provides mechanisms for walking through any arbitrary PHP variable
symfony/var-exporter               v5.3.8  v5.3.8  Allows exporting any serializable PHP data structure to plain PHP code
symfony/web-profiler-bundle        v5.0.11 v5.3.8  Symfony WebProfilerBundle
symfony/webpack-encore-bundle      v1.12.0 v1.12.0 Integration with your Symfony app & Webpack Encore!
symfony/yaml                       v5.3.6  v5.3.6  Loads and dumps YAML files

PHP version

PHP 7.4.13 (cli) (built: Nov 24 2020 12:43:30) ( NTS Visual C++ 2017 x64 )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with Zend OPcache v7.4.13, Copyright (c), by Zend Technologies
    with Xdebug v3.0.2, Copyright (c) 2002-2021, by Derick Rethans

Subject

Since the most recent Sonata Admin update (which included just #7521) my menu looks like this:

image

Oct
5
1 week ago
Activity icon
issue

jorrit issue comment doctrine-extensions/DoctrineExtensions

jorrit
jorrit

Translatable broken on orm 2.10

Hello, this morning we had to downgrade to orm 2.9 and restore our production database from backup 😢

This worked perfectly fine on doctrine/orm 2.9.*

$this->entityManager->persist(
    $entity = new Entity('in english'),
);

$this->entityManager->flush();

$entity->setTranslatableLocale('fr');
$this->entityManager->refresh($entity);

$entity->setName('in french');
$this->entityManager->persist($entity);
$this->entityManager->flush();

The result was as you'd expect - one record in the entity table for the default locale, and one in the translation table.

$entityRepository->find(1)?->getName();
// => 'in english'

Since orm 2.10., the record in the default language is overwritten with the latest translated string:

$entityRepository->find(1)?->getName();
// => 'in french'

Once again, this is actually overwritten on the database level. The string in the original language is lost. (The record on the translation table just duplicates the one on the entity table.)

Can anyone confirm/investigate please?

Thank you 🙏

jorrit
jorrit

I have this situation as well. When I update some entity, a related entity (several layers away) is updated where the default field is overwritten with the translation in the current language.

Oct
4
1 week ago
Activity icon
issue

jorrit issue comment ChilliCream/hotchocolate

jorrit
jorrit

Default variable value not used

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

In Hot Chocolate v11 I could skip a variable with a default value, like in this query:

query test($a: Boolean = true, $b: Boolean = true) {
  apiInformation {
    version @include(if: $a)
    startDate @include(if: $b)
  }
}

In v12, this doesn't work

Steps to reproduce

  1. Execute a query with a default value.
  2. Observe this error:
{
  "errors": [
    {
      "message": "The variable with the name `a` does not exist."
    }
  ]
}
  1. V11 has this output:

Relevant log output

{
  "data": {
    "apiInformation": {
      "version": "1.0.0.417",
      "startDate": "2021-10-04T09:34:52.186+02:00"
    }
  }
}

Additional Context?

No response

Product

Hot Chocolate

Version

12.0.1

jorrit
jorrit

Extra note: when the variables are required, the following error is given in V12:

{
  "errors": [
    {
      "message": "Variable `a` is required.",
      "locations": [
        {
          "line": 1,
          "column": 12
        }
      ],
      "extensions": {
        "code": "HC0018",
        "variable": "a"
      }
    }
  ]
}

With V11, that query worked as well.

Activity icon
issue

jorrit issue ChilliCream/hotchocolate

jorrit
jorrit

Default variable value not used

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

In Hot Chocolate v11 I could skip a variable with a default value, like in this query:

query test($a: Boolean = true, $b: Boolean = true) {
  apiInformation {
    version @include(if: $a)
    startDate @include(if: $b)
  }
}

In v12, this doesn't work

Steps to reproduce

  1. Execute a query with a default value.
  2. Observe this error:
{
  "errors": [
    {
      "message": "The variable with the name `a` does not exist."
    }
  ]
}
  1. V11 has this output:

Relevant log output

{
  "data": {
    "apiInformation": {
      "version": "1.0.0.417",
      "startDate": "2021-10-04T09:34:52.186+02:00"
    }
  }
}

Additional Context?

No response

Product

Hot Chocolate

Version

12.0.1

Sep
10
1 month ago
Activity icon
issue

jorrit issue fixerAPI/fixer

jorrit
jorrit

Unhelpful error message for future dates

Instead of the latest endpoint, I call the API with the current date. In this way, I get the same rates throughout the day, in case something happens to the cache. I used the current day in UTC+2 (my timezone) and it seems the API uses UTC, so for the first two hours of each day I receive an error. I'll fix this on my side, but I just wanted to mention that the error is unhelpful:

URL: http://data.fixer.io/api/2021-09-10?access_key=xxxxx&format=1&base=EUR

{
  "success":false,
  "error":{
    "code":302,
    "type":"invalid_date",
    "info":"You have entered an invalid date. [Required format: date=YYYY-MM-DD]"
  }
}

The date format is fine, it's just that the date is in the future, as seen from UTC+0. I think this situation warrants a separate error message, one which also indicates the timezone of the API server.

Sep
7
1 month ago
Activity icon
issue

jorrit issue comment mghoneimy/php-graphql-oqm

jorrit
jorrit

Don't generate empty argument objects

I have a fairly large API and as such a lot of PHP files are generated by the OQM code generator.

Most of the field in my schema have no arguments, but right now the OQM generates an empty ArgumentsObject class for each object field.

This PR enhances the code generator so an ArgumentsObject is only generated when a field accepts arguments.

jorrit
jorrit

@mghoneimy I've tried this change on my code base and it removes a large amount of useless classes.

Sep
6
1 month ago
pull request

jorrit pull request mghoneimy/php-graphql-oqm

jorrit
jorrit

Don't generate empty argument objects

I have a fairly large API and as such a lot of PHP files are generated by the OQM code generator.

Most of the field in my schema have no arguments, but right now the OQM generates an empty ArgumentsObject class for each object field.

This PR enhances the code generator so an ArgumentsObject is only generated when a field accepts arguments.

push

jorrit push jorrit/php-graphql-oqm

jorrit
jorrit

Don't generate empty argument objects

commit sha: d55a1d453d73a6a0aea71b09bfe7922b3c66fc74

push time in 1 month ago
Activity icon
created branch

jorrit in jorrit/php-graphql-oqm create branch noemptyargs

createdAt 1 month ago
push

jorrit push jorrit/php-graphql-oqm

jorrit
jorrit

Remove usage of removed EmptySelectionSetException

jorrit
jorrit

Added support for Github actions

  • Added php.yml file
  • Removed .travis.yml file
  • Updated badges in README.md
  • Added test script to composet.json
jorrit
jorrit

Add support for UNION object types

commit sha: 304b14550f52d6b5d84f89a2ca60a3baf83f0d1a

push time in 1 month ago
Aug
31
1 month ago
Activity icon
published release v0.7.0

jorrit in jorrit/SonataCloneActionBundle create published release v0.7.0

createdAt 1 month ago
Activity icon
created tag
createdAt 1 month ago
push

jorrit push jorrit/SonataCloneActionBundle

jorrit
jorrit

Directly add the hidden field to the form builder

This prevents creating an empty 'default' tab

commit sha: 34fa8c652790c07a1b6c89a55bdd9a1c4999ab9c

push time in 1 month ago
Aug
30
1 month ago
Activity icon
issue

jorrit issue symfony/symfony

jorrit
jorrit

Finder component uses backslash on Windows for remote stream wrappers

Symfony version(s) affected: 4/5

Description
I am using the Finder component with the FTP stream wrapper on Windows. Because I am using Windows, Finder and RecursiveDirectoryIterator will use backslashes, even though FTP uses forward slashes.

I think Finder should

(This seems related to #9704)

How to reproduce

On Windows, run:

$finder = new Finder();
$result = $finder
  ->in('ftp://someurl/')
  ->depth('< 2')
  ->files();

The finder will not recurse into directories in this FTP server.

Possible Solution

Finder->searchInDirectory() should set $flags |= \RecursiveDirectoryIterator::UNIX_PATHS; whenever it detects that the protocol always uses forward slashes. I think this basically means every situation where it uses a stream wrapper.

Aug
13
2 months ago
Activity icon
issue

jorrit issue comment wojtekmaj/react-daterange-picker

jorrit
jorrit

Handle clicks on the calendar hosted in Shadow DOM

Fixes #101. I tried creating a test for this, but I can't seem to trigger a click on one of the buttons and make it bubble up to the document level using Jest.

jorrit
jorrit

I tried, but generating events that bubble properly seems hard in jest / jsdom. I noticed that some click inside/outside cases had no tests either, so I figured that you also had found no way to build a test

Aug
10
2 months ago
push

jorrit push jorrit/react-daterange-picker-1

jorrit
jorrit

Fix security vulnerability in tar dependency

jorrit
jorrit

Handle clicks on the calendar hosted in Shadow DOM

commit sha: 6857669cca4d271aafbb4309215b04316e27133b

push time in 2 months ago
push

jorrit push jorrit/react-daterange-picker-1

jorrit
jorrit

Fix security vulnerability in tar dependency

jorrit
jorrit

Handle clicks on the calendar hosted in Shadow DOM

jorrit
jorrit

Add prepare script that is npm compatible

commit sha: a77fe5b94cc1724336a158dce29226a741f35f48

push time in 2 months ago
Aug
9
2 months ago
Activity icon
issue

jorrit issue comment mghoneimy/php-graphql-oqm

jorrit
jorrit

Add support for UNION object types

This needs https://github.com/mghoneimy/php-graphql-client/pull/58.

The result of this change is that the following code becomes possible:

$rootQuery = new RootQueryObject();

$ufield = $rootQuery->selectUnionField();
$ufield->onPossibleType1()->selectFieldOnTheFirstType();
$ufield->onPossibleType2()->selectFieldOnTheSecondType();
push

jorrit push jorrit/php-graphql-oqm

jorrit
jorrit

Remove usage of removed EmptySelectionSetException

jorrit
jorrit

Added support for Github actions

  • Added php.yml file
  • Removed .travis.yml file
  • Updated badges in README.md
  • Added test script to composet.json
jorrit
jorrit

Add support for UNION object types

commit sha: 3e078d805f58cd6d791ef795321bbf3b954898b0

push time in 2 months ago
Aug
4
2 months ago
Activity icon
issue

jorrit issue comment mghoneimy/php-graphql-oqm

jorrit
jorrit

Add support for UNION object types

This needs https://github.com/mghoneimy/php-graphql-client/pull/58.

The result of this change is that the following code becomes possible:

$rootQuery = new RootQueryObject();

$ufield = $rootQuery->selectUnionField();
$ufield->onPossibleType1()->selectFieldOnTheFirstType();
$ufield->onPossibleType2()->selectFieldOnTheSecondType();
jorrit
jorrit

It seems to work! I've cleaned up the Travis version matrix a bit more.

push

jorrit push jorrit/php-graphql-oqm

jorrit
jorrit

Cleanup Travis PHP version matrix

commit sha: c66b44941fc346f8dbd280008368d2f3642c4696

push time in 2 months ago
Previous