This project has been archived in favor of https://github.com/EasyCorp/easyadmin-demo
More details: https://easycorp.github.io/blog/posts/a-new-easyadmin-demo-application
A demo application to showcase EasyAdmin features
License: MIT License
This project has been archived in favor of https://github.com/EasyCorp/easyadmin-demo
More details: https://easycorp.github.io/blog/posts/a-new-easyadmin-demo-application
when editing a purchase, items are not saved.
That's important for me because I'm trying to save data with an association class (not a pure manyToMany, but a new association entity) and I need a working example, but there isn't at the moment.
Hi,
When i clone the repository and make
composer install
Error append :
There are no commands defined in the "ckeditor" namespace.
exeption
An exception has been thrown during the rendering of a template ("Notice: Array to string conversion") in form_div_layout.html.twig at line 34
on page
/admin/?action=new&entity=Purchase&menuIndex=2&submenuIndex=-1&sortField=deliveryDate&sortDirection=DESC&page=1&referer=%252Fadmin%252F%253Faction%253Dlist%2526entity%253DPurchase%2526menuIndex%253D2%2526submenuIndex%253D-1%2526sortField%253DdeliveryDate%2526sortDirection%253DDESC%2526page%253D1
In the app/config/routing.yml file, the "_homepage" route definition does not work. I guess it should redirect to the "easyadmin" (this one already exists) route instead "admin".
Hope this help
How to specify item quantity and save in purchas_item?
Where and how does PurchaseItemCrudController get used?
Sorry for my (I know) stupid questions, but I'm new to this and I'm trying to find out how to use in a situazione where there's a association table (where I don't use ManyToMany because there'are other fields too).
Thank
Notice: Trying to access array offset on value of type null in /home/rgr/Dropbox/homefiles/development/Symfony/easy-admin-demo/config/routes/../../src/Controller/ (which is being imported from "/home/rgr/Dropbox/homefiles/development/Symfony/easy-admin-demo/config/routes/annotations.yaml"). Make sure annotations are installed and enabled.
Setting my system PHP to 7.3 and it worked.
I could then revert to PHP 7.4 (update-alternatives) and it continued to work.
Hi,
i installed the project and follow the README.md, except that i use default doctrine param with the sqlite database.
The app is running on localhost:8001
If i try to edit one purchase then it fail and crash on 500
Expect : the form to edit the purchase
Get : an HTTP 500
You can repeat this process with a User edit.
The main problem is that it is trying to create a new folder with "products" as identifier, but the folder "product" (without ending s) already exist.
Diging into the config file, in the vich_uploader section, we note a little typo and changing "products" by "product" solved the problem.
Hope this helps. And congratulation for the great example.
Although EA demo is a nicely done demo, it does not demonstrate all posibilities of EA. Ie CollectionField is used nowhere, while this is a frequently used Use Case (ie create Tasks on a Project or InvoiceItems on an Invoice.
It would be great if these kind of use cases could be shown within the demo as well.
Hi,
I have a problem when I add - { type: 'divider' }
in product.yml
So, my product.yml look like this:
product.yml:
easy_admin:
entities:
Product:
class: AppBundle\Entity\Product
...
form:
fields:
- { property: 'createdAt', label: 'Crée le', css_class: 'col-sm-4' }
- { type: 'divider' }
- { property: 'name', label: 'Nom', css_class: 'col-sm-4' }
But it throw an Exeption:
RuntimeException in NormalizerConfigPass.php line 152: One of the values of the "fields" option for the "edit" view of the "AppBundle\Entity\Product" entity does not define the "property" option.
Thank you :)
Hi,
I'm trying to define a property "http_status" where input values are restricted to a range of 200-530 (HTTP status codes).
I created an annotation for the column in the entity class:
/** * @var integer * @ORM\Column(name="http_status", type="smallint", nullable=true) * @Assert\Range( * min = 200, * max = 530, * minMessage = "HTTP status code must be at least 200.", * maxMessage = "HTTP status code must not exceed 530." * ) */
But I have no idea how to create a definition for this in EasyAdminBundle. Whatever I do, no "min" and/or "max" attribute will be added to the input field.
Could you please create an example in a future version?
A possible showcase would be restricting purchases to persons aged 18 or older.
Thank you!
If you create different new products with different photos coming from your PC with the same name
example: index.png (size = 142Kb) & index.png (size = 76Kb)
As the Entity "Product" takes only a reference (name of photo file) to a folder (web/uploads/images/products) where is supposed to exist a file with that name, it can exist only one photo with the given name
reality: product1 & product2 will have last index.png of size 76Kb because first photo was overwritten
Also, if you delete/change name of photo; a broken link image is showed
Which would be the best way to change this behaviour?
Following this https://github.com/javiereguiluz/easy-admin-demo#how-to-install-this-project
"composer install" - doesn't work (as described in this issue #36)
use "compose update" and got error "The child node "from_email" at path "fos_user" must be configured"
if insert something like this into "config.yml" in "fos_user" section
from_email:
address: [email protected]
sender_name: Demo App
then everything is good
Please, change description "how-to-install-this-project" if needed
What i have done :
git clone https://github.com/javiereguiluz/easy-admin-demo
cd easy-admin-demo/
composer install
=> KO
Got following error:
Your lock file does not contain a compatible set of packages. Please run composer update.
Problem 1
- ocramius/package-versions is locked to version 1.4.2 and an update of this package was not requested.
- ocramius/package-versions 1.4.2 requires composer-plugin-api ^1.0.0 -> found composer-plugin-api[2.0.0] but it does not match the constraint.
Problem 2
- ocramius/package-versions 1.4.2 requires composer-plugin-api ^1.0.0 -> found composer-plugin-api[2.0.0] but it does not match the constraint.
- doctrine/orm v2.7.3 requires ocramius/package-versions ^1.2 -> satisfiable by ocramius/package-versions[1.4.2].
- doctrine/orm is locked to version v2.7.3 and an update of this package was not requested.
ocramius/package-versions only provides support for Composer 2 in 1.8+, which requires PHP 7.4.
To fix this error :
rm composer.lock
remove "ckeditor:install": "symfony-cmd",
line on composer.json
composer update
Composer update will fail, because symfony/yaml
dependency is missing, so i have to install it:
composer require symfony/yaml
I try to install the demo i got this error :
HP Fatal error: Uncaught Symfony\Component\Debug\Exception\FatalThrowableError: Parse error: syntax error, unexpected 'const' (T_CONST), expecting variable (T_VARIABLE) in /var/www/html/easy-admin-demo/src/Kernel.php:25
I use PHP 7.0.19-1
Now that EasyAdmin is more & more sophisticated (in the good sense of it) & powerful, maybe we can add some security related stuff to the demo ?
I'm thinking about:
When trying to create a new purchase http://127.0.0.1:8000/admin/?entity=Purchase&action=new&menuIndex=2&submenuIndex=-1&sortField=deliveryDate&sortDirection=DESC&page=1&referer=%252Fadmin%252F%253Fentity%253DPurchase%2526action%253Dlist%2526menuIndex%253D2%2526submenuIndex%253D-1%2526sortField%253DdeliveryDate%2526sortDirection%253DDESC%2526page%253D1 , I get the following exception: An exception has been thrown during the rendering of a template ("Notice: Array to string conversion").
Purchase::billingAddress property is an array, and we're trying to put it into a textarea field, which fails.
When you execute composer install it shows a message that vichuploader dev-master requieres php7.
Experienced user will not need a demo - is this agreeable?
So you should expect newbies to try this - and get frustrated hitting several walls.
I tried to understand why there is no app/app/config/parameters.yml
and found
config/packages/easy_admin.yaml
- however after following the instructions and visiting 127.0.0.1:8000/admin
I get an error:
Oops! An Error Occurred
The server returned a "500 Internal Server Error".
Something is broken. Please let us know what you were doing when this error occurred. We will fix it as soon as possible. Sorry for any inconvenience caused.
The dev webserver logs this:
[Sun Dec 23 21:03:21 2018] 127.0.0.1:56598 [500]: / - Uncaught Symfony\Component\Config\Definition\Exception\InvalidTypeException: The configured class "AppBundle\Entity\Category" for the path "easy_admin.entities.Category2" does not exist. Did you forget to create the entity class or to define its namespace? in /path/to/symfony/easy-admin-demo/vendor/javiereguiluz/easyadmin-bundle/src/Configuration/MetadataConfigPass.php:40
Stack trace:
#0 /path/to/symfony/easy-admin-demo/vendor/javiereguiluz/easyadmin-bundle/src/Configuration/ConfigManager.php(204): EasyCorp\Bundle\EasyAdminBundle\Configuration\MetadataConfigPass->process(Array)
#1 /path/to/symfony/easy-admin-demo/vendor/javiereguiluz/easyadmin-bundle/src/Configuration/ConfigManager.php(187): EasyCorp\Bundle\EasyAdminBundle\Configuration\ConfigManager->doProcessConfig(Array)
#2 /path/to/symfony/easy-admin-demo/vendor/javiereguiluz/easyadmin-bundle/src/Configuration/ConfigManager.php(67): EasyCorp\Bundle\EasyAdminBundle\Configuration\ConfigManager->processConfig()
#3 /path/to/symfo in //path/to/symfony/easy-admin-demo/vendor/javiereguiluz/easyadmin-bundle/src/Configuration/MetadataConfigPass.php on line 40
[Sun Dec 23 21:03:23 2018] 127.0.0.1:56600 [301]: /
[Sun Dec 23 21:03:23 2018] 127.0.0.1:56602 [500]: /admin/
[Sun Dec 23 21:03:31 2018] 127.0.0.1:56604 [500]: /admin/
[Sun Dec 23 21:03:33 2018] 127.0.0.1:56606 [500]: /admin/
[Sun Dec 23 21:03:34 2018] 127.0.0.1:56608 [500]: /admin/
[Sun Dec 23 21:30:03 2018] 127.0.0.1:56814 [500]: /admin/
The line that starts with #3
is no copy-paste error - the first path just ends with symfo
.
Argument 2 passed to Symfony\Component\Intl\NumberFormatter\NumberFormatter::setAttribute() must be of the type int, null given, called in D:\Proyectos\easy-admin-demo\vendor\easycorp\easyadmin-bundle\src\Intl\IntlFormatter.php on line 259
While using this in my console:
php bin/console doctrine:fixtures:load --append
I'm getting the following warning:
A:\xampp\htdocs\easy-admin-demo>php bin/console doctrine:fixtures:load --append
> loading [10] AppBundle\DataFixtures\ORM\LoadUsers
> loading [20] AppBundle\DataFixtures\ORM\LoadCategories
> loading [50] AppBundle\DataFixtures\ORM\LoadProducts
[Symfony\Component\Debug\Exception\ContextErrorException]
Warning: mt_rand(): max(-727379969) is smaller than min(1215752192)
doctrine:fixtures:load [--fixtures [FIXTURES]] [--append] [--em EM] [--shard SHARD] [--purge-with-truncate] [--multiple-transactions] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-e|--env ENV] [--no-debug] [--] <command>`
Windows 10, PHP 5.6
After going trough the rest of commands, I'm running server and can't login to admin part of the demo.
Invalid credentials.
And one more question. Where is the whole config for EasyAdmin in this demo ?
after composer install is error
ocramius/proxy-manager 2.1.0 requires php ^7.1.0 -> your PHP version (7.0.15) does not satisfy that requirement
but composer.json is >=5.5.9
some project neet multi-language entity,is any demo? thank you
If I run
bin/console doctrine:database:create
I am getting
Could not create database
asy-admin
for connection named default
An exception occured in driver: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: NO)
My parameters.yml file looks so:
parameters:
database_url: easy-admin
secret: 23478qwjhsdf328z43sfsadf
How shall I define the database configuration?
I found an error on the purchase edit page:
Catchable Fatal Error: Object of class AppBundle\Entity\User could not be converted to string
Script ckeditor:install returned with error code 1
!!
!!
!! There are no commands defined in the "ckeditor" namespace.
!!
!!
!!
Script @auto-scripts was called via post-update-cmd
Hello and my apologies if it is a stupid question.
The only config file I could found was the .backup at the root of the repo, but it is impossible to read as it seems minified in some way, am I missing the obvious?
This would be really useful in understanding how some of these cases were built rather than just demonstrating the capabilities.
I originally came here as I was struggling with an edge case but I am still stuck.
Thank you
Warning: Uncaught ReflectionException: Class "Doctrine\Common\Persistence\ObjectManager" not found while loading "App\DataFixtures\LoadCategories"
- use Doctrine\Common\Persistence\ObjectManager;
+ use Doctrine\Persistence\ObjectManager;
When I execute the command php bin/console server:run
as described in the readme, I do get the following error with Symfony 3.3:
[Symfony\Component\Console\Exception\CommandNotFoundException]
There are no commands defined in the "server" namespace.
To fix the error one has to register the WebServerBundle in AppKernel.php
(see https://stackoverflow.com/a/43119148/1119601),
Hi
can you add this line after the 6d line?
php bin/console doctrine:schema:update -f
I'm testing this demo project and i get an error when i try to edit a product.
Change the title
Click on submit
Expected : The item is saved with the new title
Get : Warning on input Image because it need one (even if we don't want to change it)
Hello,
I'm getting the following error after the composer install & starting the install script.
Fatal error: Uncaught Symfony\Component\Debug\Exception\FatalThrowableError: Type error: Return value of ProxyManager\Configuration::setGeneratorStrategy() must be an instance of ProxyManager\void, none returned in /Users/nicolaswidart/Sites/Tests/easy-admin-demo/vendor/ocramius/proxy-manager/src/ProxyManager/Configuration.php:124
Stack trace:
#0 /Users/nicolaswidart/Sites/Tests/easy-admin-demo/vendor/symfony/symfony/src/Symfony/Bridge/ProxyManager/LazyProxy/Instantiator/RuntimeInstantiator.php(37): ProxyManager\Configuration->setGeneratorStrategy(Object(ProxyManager\GeneratorStrategy\EvaluatingGeneratorStrategy))
#1 /Users/nicolaswidart/Sites/Tests/easy-admin-demo/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php(625): Symfony\Bridge\ProxyManager\LazyProxy\Instantiator\RuntimeInstantiator->__construct()
#2 /Users/nicolaswidart/Sites/Tests/easy-admin-demo/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php(574): Symfony\Component\HttpKernel\Kernel->getContainerBuilder()
#3 /Users/nicolaswid in /Users/nicolaswidart/Sites/Tests/easy-admin-demo/vendor/ocramius/proxy-manager/src/ProxyManager/Configuration.php on line 124
PHP Fatal error: Uncaught Symfony\Component\Debug\Exception\FatalThrowableError: Type error: Return value of ProxyManager\Configuration::setGeneratorStrategy() must be an instance of ProxyManager\void, none returned in /Users/nicolaswidart/Sites/Tests/easy-admin-demo/vendor/ocramius/proxy-manager/src/ProxyManager/Configuration.php:124
Stack trace:
#0 /Users/nicolaswidart/Sites/Tests/easy-admin-demo/vendor/symfony/symfony/src/Symfony/Bridge/ProxyManager/LazyProxy/Instantiator/RuntimeInstantiator.php(37): ProxyManager\Configuration->setGeneratorStrategy(Object(ProxyManager\GeneratorStrategy\EvaluatingGeneratorStrategy))
#1 /Users/nicolaswidart/Sites/Tests/easy-admin-demo/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php(625): Symfony\Bridge\ProxyManager\LazyProxy\Instantiator\RuntimeInstantiator->__construct()
#2 /Users/nicolaswidart/Sites/Tests/easy-admin-demo/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php(574): Symfony\Component\HttpKernel\Kernel->getContainerBuilder()
#3 /Users/nicolaswid in /Users/nicolaswidart/Sites/Tests/easy-admin-demo/vendor/ocramius/proxy-manager/src/ProxyManager/Configuration.php on line 124
Script Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache handling the post-install-cmd event terminated with an exception
[RuntimeException]
An error occurred when executing the "'cache:clear --no-warmup'" command:
Fatal error: Uncaught Symfony\Component\Debug\Exception\FatalThrowableError: Type error: Return value of ProxyManager\Conf
iguration::setGeneratorStrategy() must be an instance of ProxyManager\void, none returned in /Users/nicolaswidart/Sites/Te
sts/easy-admin-demo/vendor/ocramius/proxy-manager/src/ProxyManager/Configuration.php:124
Stack trace:
#0 /Users/nicolaswidart/Sites/Tests/easy-admin-demo/vendor/symfony/symfony/src/Symfony/Bridge/ProxyManager/LazyProxy/Insta
ntiator/RuntimeInstantiator.php(37): ProxyManager\Configuration->setGeneratorStrategy(Object(ProxyManager\GeneratorStrateg
y\EvaluatingGeneratorStrategy))
#1 /Users/nicolaswidart/Sites/Tests/easy-admin-demo/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php(625
): Symfony\Bridge\ProxyManager\LazyProxy\Instantiator\RuntimeInstantiator->__construct()
#2 /Users/nicolaswidart/Sites/Tests/easy-admin-demo/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php(574
): Symfony\Component\HttpKernel\Kernel->getContainerBuilder()
#3 /Users/nicolaswid in /Users/nicolaswidart/Sites/Tests/easy-admin-demo/vendor/ocramius/proxy-manager/src/ProxyManager/Co
nfiguration.php on line 124
PHP Fatal error: Uncaught Symfony\Component\Debug\Exception\FatalThrowableError: Type error: Return value of ProxyManager
\Configuration::setGeneratorStrategy() must be an instance of ProxyManager\void, none returned in /Users/nicolaswidart/Sit
es/Tests/easy-admin-demo/vendor/ocramius/proxy-manager/src/ProxyManager/Configuration.php:124
Stack trace:
#0 /Users/nicolaswidart/Sites/Tests/easy-admin-demo/vendor/symfony/symfony/src/Symfony/Bridge/ProxyManager/LazyProxy/Insta
ntiator/RuntimeInstantiator.php(37): ProxyManager\Configuration->setGeneratorStrategy(Object(ProxyManager\GeneratorStrateg
y\EvaluatingGeneratorStrategy))
#1 /Users/nicolaswidart/Sites/Tests/easy-admin-demo/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php(625
): Symfony\Bridge\ProxyManager\LazyProxy\Instantiator\RuntimeInstantiator->__construct()
#2 /Users/nicolaswidart/Sites/Tests/easy-admin-demo/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php(574
): Symfony\Component\HttpKernel\Kernel->getContainerBuilder()
#3 /Users/nicolaswid in /Users/nicolaswidart/Sites/Tests/easy-admin-demo/vendor/ocramius/proxy-manager/src/ProxyManager/Co
nfiguration.php on line 124
.
Thanks,
How do we handle the error in CrudController, under method configureFields(string $pageName)
I have an ImageField, scenario is that supposedly the file uploaded gone missing. (someone accidentally deleted / renamed that file)
I get hit with the error FileNotFoundException.
Hello there, I discovered an occasional error when trying to load fixtures for the easy admin demo:
#> php .\bin\console doctrine:fixtures:load --append
> loading [10] App\DataFixtures\ORM\LoadUsers
> loading [20] App\DataFixtures\ORM\LoadCategories
> loading [50] App\DataFixtures\ORM\LoadProducts
> loading [100] App\DataFixtures\ORM\LoadPurchases
[Doctrine\DBAL\Exception\UniqueConstraintViolationException]
An exception occurred while executing 'INSERT INTO purchase (id, guid, delivery_date, created_at, shipping, delivery_hour, billing_address, buye
r_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?)' with params ["120183410587839001544304650", "71d2a747-1227-47f7-a54c-e349567c78bf", "2018-12-13", "2018-1
2-08 22:30:55", "O:8:\"stdClass\":0:{}", "13:00:00", "\"{\\\"line1\\\":\\\"1234 Main Street\\\",\\\"line2\\\":\\\"Big City, XX 23456\\\"}\"", 48
]:
SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '120183410587839001544304650' for key 'PRIMARY'
It seems to me that this is related to the way the unique identifier for the 'Purchase' entity is being generated:
public function generateId($storeId = 1)
{
return preg_replace('/[^0-9]/i', '', sprintf('%d%d%03d%s', $storeId, date('Y'), date('z'), microtime()));
}
This effectively turns the 'uniqueness' of the generated identifier into a race-condition (because '$storeId' always defaults to '1').
On file:
./src/Kernel.php
class Kernel extends BaseKernel
{
use MicroKernelTrait;
private const CONFIG_EXTS = '.{php,xml,yaml,yml}';
This isn't allowed on PHP < 7.1
So, a "workaround" will be:
class Kernel extends BaseKernel
{
use MicroKernelTrait;
/**
* Only PHP > 7.1:
* private const CONFIG_EXTS = '.{php,xml,yaml,yml}';
*/
const CONFIG_EXTS = '.{php,xml,yaml,yml}';
Regards.
Appologies for reopening issue but i still have this problem.
Form will not allow you to submit because the field is required, regardless of if you intend to change the image or not.
It should be usefull not allow admin users like "john.smith" not to disallow himself in the users menu.
Can a Warning appear at the top of the main view?
If this happen, the only way to take control of the app is modifying the values with a MySQL querry in server side.
Hi,
Error from GUI:
The configured class "App\Entity\Product" for the path "easy_admin.entities.Product" does not exist. Did you forget to create the entity class or to define its namespace?
$ ls -a
. .gitignore composer.json src vendor
.. .travis.yml composer.lock templates
.env LICENSE config tests
.env.dist README.md phpunit.xml.dist translations
.git bin public var
Environment:
OSX10.12.6
PHP: 7.1.11
Zend Engine: v3.1.0
Steps:
composer create-project symfony/framework-standard-edition max "3.3.*"
cd max
change: url: '%env(resolve:DATABASE_URL)%'
to: url: '%env(DATABASE_URL)%'
composer require symfony/web-server-bundle
vi : config/routes.yml
ADD>>>
easy_admin_bundle:
resource: "@EasyAdminBundle/Controller/AdminController.php"
type: annotation
prefix: /admin
Anything obvious I am missing?
Cheers,
Max
Hello.
In my ListView of entity, when I search over datetime field, this is not included in query.
I try included manually (but not result):
search: fields: ['fechaAlta','fechaVisto','fechaFirma']
Thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.