Skip to content

walva/api-platform-core-issue-4144

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

api-platform-core-issue-4144

Issue #4144 : Comparing with Null Values doesn't work with embeddables

How to run

  • setup the project
git clone https://github.com/walva/api-platform-core-issue-4144.git
composer install
bin/console doctrine:database:create
bin/console doctrine:schema:create
bin/console hautelook:fixtures:load
php -S 127.0.0.1:8000 -t public
  • edit manually the data: update book#2 in order to set a null value
curl -X PATCH "http://127.0.0.1:34623/api/books/2" -H  "accept: application/ld+json" -H  "Content-Type: application/merge-patch+json" -d "{\"rankings\":{\"trendy\":null}}"
#[ApiFilter(OrderFilter::class, properties: [
    'rankings.trendy' => [
        'nulls_comparison' => OrderFilter::NULLS_LARGEST,
    ],
])]

🛑 Instead, it throws a Doctrine\ORM\Query\QueryException

[Syntax Error] line 0, col 85: Error: Expected Doctrine\ORM\Query\Lexer::T_FROM, got '.'

Recipe

composer create-project symfony/skeleton bug-embeddable-filter
cd bug-embeddable-filter
composer require api
composer require make
composer require --dev profiler
php bin/console make:entity
	> Book
	> yes
	> name
	> string
	> 255
	> yes
php bin/console make:entity
	> Ranking
	> yes
	> trendy
	> integer
	> yes
	> popular
	> integer
	> yes
composer require --dev alice
bin/console doctrine:database:create
bin/console doctrine:schema:create
bin/console hautelook:fixtures:load
php -S 127.0.0.1:8000 -t public

About

Comparing with Null Values doesn't work with embeddables

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published