I tried to make the subject descriptive enough, but it's kinda hard to explain
What I am facing is what I think is a bug in caching of document objects. Ill try to explain below.
I have a view script containing a multihref element, which I use to generate a very basic navigation of sorts ( slightly simplified ):
- Code: Select all
<?php $footerExtra = $this->multihref("footerExtra", array('width' => 300, 'title' => 'Privacy/Voorwaarden/etc.')); ?>
<?php if ($this->editmode): ?>
<?php echo $footerExtra ?>
<?php else: ?>
<?php foreach($footerExtra as $element): ?>
<a href="<?php echo $element->getFullPath(); ?>" title="<?php echo $element->getTitle(); ?>"><?php echo $element->getName(); ?></a>
<?php endforeach; ?>
<?php endif; ?>
I then retrieve the document via a predefined property ( document type ), and display it using the inc() helper:
- Code: Select all
$footerDoc = $this->document->getProperty("footerDoc");
if($footerDoc instanceof Document_Page) {
// Option 1: This works, but doesn't show the multihref content
// echo $this->inc($footerDoc);
// Option 2: This works, and includes the multihref content
echo $this->inc($footerDoc->getId());
}
I commented which method does work and which doesn't. When I pass the Document_Page as parameter the multihref remains empty (option 1). When I get it's id and pass that along the multihref loads as it should (option 2).
Another way to make it work is to use option 1 and passing the nocache parameter in the url ( or turning it off in the code, by unregistering the plugin or such ). Note: I have output-caching turned of in the settings.
I've also tried to use ZF's action() helper and passing the document as parameter, which yields the same result as option 1.
So reloading the document, which is what happens when you pass an id unstead of a Document_Page as inc() parameter, does load the multihref ( option 2 ).
Am I doing anything wrong? Or did I stumble on a bug?
I must admit this is the first project where I use this technique, and only the third project I built using Pimcore ( of which none are online still xD ), so it could just be my newbism getting in the way. That said, I'm planning on using Pimcore for a lot of projects in the (near) future, so I'd love to learn all there is to it.
Thanks in advance!