DDC-3188: Call to a member function getValue() on a non-object in vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php #3951

Closed
opened 2026-01-22 14:32:13 +01:00 by admin · 7 comments
Owner

Originally created by @doctrinebot on GitHub (Jun 24, 2014).

Originally assigned to: @ostrolucky on GitHub.

Jira issue originally created by user dwieeb:

This is the line that causes the fatal error: https://github.com/doctrine/doctrine2/blob/v2.4.2/lib/Doctrine/ORM/UnitOfWork.php#L678

This is the association that is breaking it (i.e. reflFields[ 'user' ] is a non-object):

/****
 * @ManyToOne(targetEntity="User")
 * @JoinColumn(name="user_id", referencedColumnName="id")
 *
 * @var User
 */
protected $user;

This is the pk of the referenced entity.

/****
 * @Id
 * @Column(name="id", type="bigint", nullable=false)
 *
 * @var int
 */
protected $id;

If an exception was thrown due to missing metadata information, I could catch it, but fatal errors due to this bug have been crashing our scripts and they've had to be manually restarted.

Let me know what other information is needed.

Full stack trace:
{quote}
PHP 5. Doctrine\ORM\EntityManager->flush() our_code.php
PHP 6. Doctrine\ORM\UnitOfWork->commit() vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php:389
PHP 7. Doctrine\ORM\UnitOfWork->computeChangeSets() vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php:297
PHP 8. Doctrine\ORM\UnitOfWork->computeScheduleInsertsChangeSets() vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php:703
PHP 9. Doctrine\ORM\UnitOfWork->computeChangeSet() vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php:404
PHP Fatal error: Call to a member function getValue() on a non-object in vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php on line 678
{quote}

Originally created by @doctrinebot on GitHub (Jun 24, 2014). Originally assigned to: @ostrolucky on GitHub. Jira issue originally created by user dwieeb: This is the line that causes the fatal error: https://github.com/doctrine/doctrine2/blob/v2.4.2/lib/Doctrine/ORM/UnitOfWork.php#L678 This is the association that is breaking it (i.e. reflFields[ 'user' ] is a non-object): ``` /**** * @ManyToOne(targetEntity="User") * @JoinColumn(name="user_id", referencedColumnName="id") * * @var User */ protected $user; ``` This is the pk of the referenced entity. ``` /**** * @Id * @Column(name="id", type="bigint", nullable=false) * * @var int */ protected $id; ``` If an exception was thrown due to missing metadata information, I could catch it, but fatal errors due to this bug have been crashing our scripts and they've had to be manually restarted. Let me know what other information is needed. Full stack trace: {quote} PHP 5. Doctrine\ORM\EntityManager->flush() our_code.php PHP 6. Doctrine\ORM\UnitOfWork->commit() vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php:389 PHP 7. Doctrine\ORM\UnitOfWork->computeChangeSets() vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php:297 PHP 8. Doctrine\ORM\UnitOfWork->computeScheduleInsertsChangeSets() vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php:703 PHP 9. Doctrine\ORM\UnitOfWork->computeChangeSet() vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php:404 PHP Fatal error: Call to a member function getValue() on a non-object in vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php on line 678 {quote}
admin added the Bug label 2026-01-22 14:32:13 +01:00
admin closed this issue 2026-01-22 14:32:13 +01:00
Author
Owner

@doctrinebot commented on GitHub (Jun 24, 2014):

Comment created by @ocramius:

Did you actually validate your mappings?

@doctrinebot commented on GitHub (Jun 24, 2014): Comment created by @ocramius: Did you actually validate your mappings?
Author
Owner

@doctrinebot commented on GitHub (Jun 24, 2014):

Comment created by dwieeb:

I did not validate the mapping. I did not know about the orm:validate-schema until just now. I will fix these errors and resubmit if there is still an issue.

Sorry about that, thanks.

@doctrinebot commented on GitHub (Jun 24, 2014): Comment created by dwieeb: I did not validate the mapping. I did not know about the orm:validate-schema until just now. I will fix these errors and resubmit if there is still an issue. Sorry about that, thanks.
Author
Owner

@doctrinebot commented on GitHub (Jun 24, 2014):

Comment created by dwieeb:

The tweet and user relationship is not in the list of invalid mappings.

@doctrinebot commented on GitHub (Jun 24, 2014): Comment created by dwieeb: The tweet and user relationship is not in the list of invalid mappings.
Author
Owner

@doctrinebot commented on GitHub (Jun 26, 2014):

Comment created by @ocramius:

Are User and Tweet in the same namespace?

@doctrinebot commented on GitHub (Jun 26, 2014): Comment created by @ocramius: Are `User` and `Tweet` in the same namespace?
Author
Owner

@doctrinebot commented on GitHub (Jun 27, 2014):

Comment created by dwieeb:

Yes, and I've since then used the FQNS. I would get a class not found error when validating schema.
This is something that I know can't really be debugged by you guys, I was just hoping for a little direction. We are using memcache to store our metadata, and we are clearing and regenerating the metadata during every deploy (it is not autogenerated). I'm now using a commit hash as the namespace of the metadata, so we'll see if this fixes the issue.

@doctrinebot commented on GitHub (Jun 27, 2014): Comment created by dwieeb: Yes, and I've since then used the FQNS. I would get a class not found error when validating schema. This is something that I know can't really be debugged by you guys, I was just hoping for a little direction. We are using memcache to store our metadata, and we are clearing and regenerating the metadata during every deploy (it is not autogenerated). I'm now using a commit hash as the namespace of the metadata, so we'll see if this fixes the issue.
Author
Owner

@doctrinebot commented on GitHub (Jun 27, 2014):

Comment created by @ocramius:

It looks like a typo (CasESensiTIViTy issue) to me.

@doctrinebot commented on GitHub (Jun 27, 2014): Comment created by @ocramius: It looks like a typo (CasESensiTIViTy issue) to me.
Author
Owner

@ostrolucky commented on GitHub (Aug 7, 2018):

Closing due to lack of feedback. If this is still an issue, please let us know by commenting here.

@ostrolucky commented on GitHub (Aug 7, 2018): Closing due to lack of feedback. If this is still an issue, please let us know by commenting here.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#3951