DDC-439: Error in CLI utility with YAML files #547

Open
opened 2026-01-22 12:42:07 +01:00 by admin · 0 comments
Owner

Originally created by @doctrinebot on GitHub (Mar 18, 2010).

Jira issue originally created by user ssurowiec:

While running the CLI utility via Symfony2's console I received the following error:

Notice: Undefined offset: 0 in /home/steve/apps/data_warehouse/src/vendor/doctrine/lib/Doctrine/Common/Cli/CliController.php line 234

The entity file was being created properly but it wouldn't create the table in the database. If I ran with just --entities it would build the entity with no errors but as soon as I added --and-update-schema or changed it to --all I'd get the error. I tested with an XML mapping file and had no issues. But when I ran it with a YAML file I started seeing this.

Upon investigation it looks like the $args array contained the following values (there may have been more but it was dieing on the last one):
--0=create
--1=drop
--2=update
--3=complete-update
--4=re-create
--5=dump-sql
--complete-update=1
--class-dir=

This was causing $value to be an empty array which allowed it to get passed the check on line 231 of CliController.php. If I changed that line to include an '|| ! count($value)' check it ran fine without any problems that I can see.

Originally created by @doctrinebot on GitHub (Mar 18, 2010). Jira issue originally created by user ssurowiec: While running the CLI utility via Symfony2's console I received the following error: Notice: Undefined offset: 0 in /home/steve/apps/data_warehouse/src/vendor/doctrine/lib/Doctrine/Common/Cli/CliController.php line 234 The entity file was being created properly but it wouldn't create the table in the database. If I ran with just --entities it would build the entity with no errors but as soon as I added --and-update-schema or changed it to --all I'd get the error. I tested with an XML mapping file and had no issues. But when I ran it with a YAML file I started seeing this. Upon investigation it looks like the $args array contained the following values (there may have been more but it was dieing on the last one): --0=create --1=drop --2=update --3=complete-update --4=re-create --5=dump-sql --complete-update=1 --class-dir= This was causing $value to be an empty array which allowed it to get passed the check on line 231 of CliController.php. If I changed that line to include an '|| ! count($value)' check it ran fine without any problems that I can see.
admin added the Bug label 2026-01-22 12:42:07 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#547