Multihref data in inc() missing

Controllers / Actions and Views, Properties, Editables, Areas, Pages, Snippets, Links, Navigation, ...

Multihref data in inc() missing

Postby satsume » Sat Apr 07, 2012 11:25 am

Hello,

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!
satsume
 
Posts: 15
Joined: Sat Apr 07, 2012 10:45 am

Re: Multihref data in inc() missing

Postby satsume » Wed Apr 11, 2012 8:08 pm

Update:

Below is what I thought before, but is wrong:
I know turned on output caching, which I didn't think would be a problem, but the same issues occur. The multihref data is missing in the included ( inc() ) document view script.

Whereas one would think all the content of the page would be cached?


The error still lies in passing the Document_Page as parameter.

I still think this has something to do with caching of the document or multihref though!
satsume
 
Posts: 15
Joined: Sat Apr 07, 2012 10:45 am


Return to Documents

Who is online

Users browsing this forum: No registered users and 0 guests

cron