Bug #52907

#1355480641: Uncaught Exception

Added by Kay Strobach almost 8 years ago. Updated over 7 years ago.

Status:
Resolved
Priority:
Should have
Category:
Persistence
Target version:
-
Start date:
2013-10-17
Due date:
% Done:

100%

Estimated time:
PHP Version:
Has patch:
No
Complexity:

Description

OneToMany mapping on field 'measurementDataRecords' requires the
'mappedBy' attribute.

More Information
Exception code #0
File /project/Packages/Libraries/doctrine/orm/lib/Doctrine/ORM/Mapping/MappingException.php line 150

The Exception message should name the declaring class for the not interpretable property ...


Files

exception.png (46.7 KB) exception.png Bastian Waidelich, 2013-10-17 10:21
2013-10-17_10-41-58.png (145 KB) 2013-10-17_10-41-58.png Kay Strobach, 2013-10-17 10:47
exception_new.png (30.9 KB) exception_new.png Bastian Waidelich, 2013-10-17 11:57
#1

Updated by Adrian Föder almost 8 years ago

  • Status changed from New to Rejected

Hello Kay,

this is a Doctrine exception, hence out of the competence of Flow...
Feel free to reopen if you disagree in any kind.

Best,
Adrian

#2

Updated by Kay Strobach almost 8 years ago

mhmm ok, but it would be possible to catch and enhance it ;) - for usability reasons a good error message would be great ;)

#3

Updated by Adrian Föder almost 8 years ago

I think that would open kind of a "box" if it's started to catch these kind of errors. I even suspect that's rather hard because Flow only "prepares" the data Doctrine is fed with, and hands it over completely to doctrine later than.

#4

Updated by Bastian Waidelich almost 8 years ago

Hi Kay,

can you give some more context? Where do you get this exception? If I add a property:

    /**
     * @var \Doctrine\Common\Collections\ArrayCollection<\MyPackage\Domain\Model\Product>
     * @ORM\OneToMany()
     */
    protected $foos;

I get a wrapping exception that shows the affected class name:

#5

Updated by Bastian Waidelich almost 8 years ago

  • Project changed from TYPO3 Flow Base Distribution to TYPO3.Flow
  • Assignee set to Bastian Waidelich
#6

Updated by Kay Strobach almost 8 years ago

keep it closed - i agree. I had a misconfigured Entity (created out of the context and then copied into a FLOW project)
If normally there is a wrapping exception this is totally fine.

#7

Updated by Bastian Waidelich almost 8 years ago

  • Has patch set to No

Kay Strobach wrote:

keep it closed - i agree. I had a misconfigured Entity (created out of the context and then copied into a FLOW project)
If normally there is a wrapping exception this is totally fine.

Sorry, what I meant with "context" is:

  • What did you change? (you created/pasted a misconfigured entity to Flow, right?)
  • When did the exception occur?

or other words: How can we reproduce this? ;)

#8

Updated by Kay Strobach almost 8 years ago

this is how i produced the exception.

**
 * set of parameters for an abstract measurement series
 *
 * @Flow\Entity
 *
 */
class MeasurementSeries {

    /**
     * @ORM\OneToMany
     * @var \Doctrine\Common\Collections\Collection<\Vendor\Logger\Domain\Model\MeasurementDataRecord>
     */
    protected $measurementDataRecords = null;
}
#10

Updated by Bastian Waidelich almost 8 years ago

Ok, thanks to your feedback I could reproduce the issue (it happens only after flushing the cache, after a refresh you get the nested exception).
I could wrap the code that throws the exception so that the initial exception now contains more details:

I'm pushing review request now, hoping for feedback from Karsten (aka Mr. Doctrine)

#11

Updated by Gerrit Code Review almost 8 years ago

  • Status changed from Accepted to Under Review

Patch set 1 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/24862

#12

Updated by Kay Strobach almost 8 years ago

THX

#13

Updated by Bastian Waidelich almost 8 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
#14

Updated by Gerrit Code Review almost 8 years ago

  • Status changed from Resolved to Under Review

Patch set 1 for branch 2.0 of project Packages/TYPO3.Flow has been pushed to the review server.
It is available at https://review.typo3.org/25873

#15

Updated by Kay Strobach over 7 years ago

can be closed imho, as gerrit states it as resolved ...

#16

Updated by Bastian Waidelich over 7 years ago

  • Status changed from Under Review to Resolved

Thx ;)

Also available in: Atom PDF