Uploaded image for project: 'Doctrine PHPCR'
  1. Doctrine PHPCR
  2. PHPCR-70

ContentDocument Relationships returning NULL in Action


    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Labels:


      So i have 2 Documents:

      Page: http://pastebin.com/b5X32JPc

      Category: http://pastebin.com/A1gB6kyg

      A Category has many pages.

      Now here's my (test) action: http://pastebin.com/ypjxqZPu

      As you can see, $contentDocument is a page in this case. If i call $contentDocument->category i get back "null".

      If however i tell the document manager to fetch the Page document by it's path, then $contentDocument->category will work...

      Our conclusion is that if you take the $contentDocument that is passed to your action, and you try to fetch it's ParentDocument inside the action (mapped to a property) you always get null.
      However, what is very weird, is that inside twig it works (page.category would work in twig but page->category would return null inside the action, before the twig render)


        freddyh Freddy H. created issue -
        dbu David Buchmann made changes -
        Field Original Value New Value
        Assignee Lukas Kahwe [ lsmith ] David Buchmann [ dbu ]
        lsmith Lukas Kahwe made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Assignee David Buchmann [ dbu ] Lukas Kahwe [ lsmith ]
        Resolution Fixed [ 1 ]


          • Assignee:
            lsmith Lukas Kahwe
            freddyh Freddy H.
          • Votes:
            0 Vote for this issue
            1 Start watching this issue


            • Created: