CMF + JAckrabbit

63 views
Skip to first unread message

federico panini

unread,
Jul 8, 2015, 2:21:42 AM7/8/15
to symfony-...@googlegroups.com
Hi all,
I have a problem with one of our CMF installation :

- production : 
       symfony-cmf/symfony-cmf 1.1
       symfony-cmf/simple-cms-bundle 1.1

       jackrabbit 2.8 (configure on september 2014)
       jackrabbit persistence on MYSQL


We're updating our architecture, so I need to setup a new jackrabbit server,
export the content from the old one and import the content to a new installation
of Jackrabbit 2.10.1. We decided also to move to symfony cmf 1.2....

so the new setup will be :
       symfony-cmf/symfony-cmf 1.2
       symfony-cmf/simple-cms-bundle 1.2

       jackrabbit 2.10.1
       jackrabbit persistence on MYSQL


At the moment our test are going well, we use also sonataAdmin as admin panel, 
and sonataMedia, and the overall upgrade seems to work fine (except for minor
problem I have to solve..).
The problem is this : I export from the old jackrabbit with doctrine:phpcr:workspace:export 
command to a file I import in the new installation.
Magically the admin seems to work, I can see the whole documents (admin/dashboard) and the whole images
I created during the last year. The problem is on the frontend :
there are some pages that returns me this error and I don't understand why :

An exception has been thrown during the rendering of a template ("Can not determine the prefix. Either this is a new, unpersisted document or the listener that calls setPrefix is not set up correctly.") in MyCompanyWebsiteBundle:PageContent:_posts.html.twig at line 18.


The error is generated in a twig file when I try to print out a path inside a link :
<a href="{{path(post.author)}}">Author Name</a>

I have a document Post which ha a relation with a document Author (my website is a blog website :) )
this is the annotation inside the document Post :
    /**
     * @PHPCR\ReferenceOne(strategy="hard", targetDocument="MyCompany\WebsiteBundle\Document\Author")
     * @var mixed
     */
    private $author;

If I remove the access to author from Post everything works fine :)
The idea I had is that I have a problem on the import side and I'll explain why :

if I print out the {{cmf_path(post.author)}} I see this 

/jcr:root/jcr:root/cms/content/author/federico-panini (with this path the path(post.author) will broke for sure!)

the right path should be :

/cms/content/author/federico-panini

I've tried many ways... but unsuccessfully, any one can give me an hint on how to solve it, or maybe where to have a look at ?

thank you very much
Federico.

David Buchmann

unread,
Jul 8, 2015, 2:30:21 AM7/8/15
to symfony-...@googlegroups.com
hi federico,

this indeed looks like a problem with exporting and importing. try to
either move /jcr:root/jcr:root/cms to /cms or to not export the complete
repository but only /cms (there is an option to the export command to
limit to only a path).

before importing, delete /jcr:root in the new repo (and when importing
again, you will need to first delete /cms to start with a clean repo)

does that help?

david
> --
> You received this message because you are subscribed to the Google
> Groups "symfony-cmf-devs" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to symfony-cmf-de...@googlegroups.com
> <mailto:symfony-cmf-de...@googlegroups.com>.
> For more options, visit https://groups.google.com/d/optout.

--
Liip AG // Agile Web Development // T +41 43 500 39 80
CH-8005 Zurich // PGP 0xA581808B // www.liip.ch

Uwe Jäger

unread,
Jul 8, 2015, 2:59:09 AM7/8/15
to symfony-...@googlegroups.com
I usually export only /cms and do a purge before importing. That usually works.

To unsubscribe from this group and stop receiving emails from it, send an email to symfony-cmf-de...@googlegroups.com.

federico panini

unread,
Jul 8, 2015, 5:44:52 AM7/8/15
to symfony-...@googlegroups.com
Ehy guys it works like a charm.....
the weird thing (or maybe my lack of deep knowledge of Jackrabbit) is
that after purging the workspace (doctrine:phpcr:workspace:purge)
I can see that the workspace contains only ROOT.
If I import the XML from production (the node:dump) shows me this tree :

ROOT:
      cms:
        content

in fact the twig function cmf_path(post) returns me /jcr:root/cms/content.... and brake
the function. The suggestion from David is correct, even if I don't see with a dump
the jcr:root node, before importing the xml I force a 

doctrine:phpcr:node:remove /jcr:root

remove this "hidden" node, and now everything works perfect!

Thank you guys again.
u rock!


--
You received this message because you are subscribed to a topic in the Google Groups "symfony-cmf-devs" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/symfony-cmf-devs/YcNE2mRK3LE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to symfony-cmf-de...@googlegroups.com.

David Buchmann

unread,
Jul 8, 2015, 12:43:53 PM7/8/15
to symfony-...@googlegroups.com
> even if I don't see a dump
> the jcr:root node, before importing the xml I force a
>
> doctrine:phpcr:node:remove /jcr:root
>
> remove this "hidden" node, and now everything works perfect!

yeah i think this is a shortcoming of our dump command. we assume that
nodes in the root that are in namespace "jcr:" are system nodes and not
to be shown. maybe we should tweak things to not hide jcr:root as its
weird if that exists as an actual node.

> Thank you guys again.
> u rock!

thanks!
Reply all
Reply to author
Forward
0 new messages