This application is not used any more and exists only for history. Post new tickets on the Github account.
Cette application n'est plus utilisée, et existe uniquement pour son historique. Postez les nouveaux tickets sur le compte github.

Ticket #1197 (closed bug: fixed)

Opened 4 years ago

Last modified 2 years ago

zone tpl plugin does not work with meta tpl plugins of a cached zone template

Reported by: bricet Owned by:
Priority: normal Milestone:
Component: jelix:plugins:tpl Version: trunk
Severity: normal Keywords:
Cc: Blocked By:
Blocking: Documentation needed: no
Hosting Provider: Php version:

Description

As for #1196 , the {zone} plugin for templates does not take into account metas of a zone which have a _templatename set. This occurs when this zone is cached. This is a cascading situation, but this may happen ...

Here is a patch.

Attachments

ticket_1197.patch (719 bytes) - added by bricet 4 years ago.

Change History

Changed 4 years ago by bricet

comment:1 Changed 4 years ago by bricet

  • review set to review?

comment:2 Changed 4 years ago by laurentj

  • Milestone Jelix 1.2 deleted

sorry, too late for 1.2

comment:3 follow-up: ↓ 4 Changed 4 years ago by laurentj

  • review changed from review? to review-

There isn't any method getMeta on jZone... And I think the issue is not on the zone publing but on jZone directly.

No time to investigate for the moment.

comment:4 in reply to: ↑ 3 Changed 4 years ago by bricet

Replying to laurentj:

There isn't any method getMeta on jZone... And I think the issue is not on the zone publing but on jZone directly.

Sorry I forgot a piece of the patch ...

No time to investigate for the moment.

You're right. This patch is dumb as metas are included twice at least in most cases. I will think again about this problem. Actually I think I've gone throught it too fast and did not notice exactly in which cases the bug occurs ... if there is a bug (big doubt, now).

Sorry for the inconvenience ...

comment:5 Changed 4 years ago by bricet

After thinking a bit about it and before forgetting :

I can see at least one case in which there is a bug :

Let's have 2 zones : zA and zB.

zA has :

protected $_tplname='tA';
protected $_useCache = true ;

zB has :

protected $_tplname='tB';

In tA, we have :

{zone 'zB'}

And in tB :

{meta author 'jelix'}

This meta will be used only on first load (i.e. when zA 's cache is built). But on next loads, it won't be used. This is because zA 's content has been cached but not metas (because of the way metas are handled in a different way than content by jTpl).

To me, a way to solve that, would be that {zone} jTpl plugin does not call jZone::get() but :

  • set a 'jZone::getMeta()' in $compiler->addMetaContent (I have already something like that)
  • returns 'jZone::getContentOnly()' (i.e. something that does the same as jZone::get() but does not handle metas of $_tplname

I will try to make a patch as soon as I have time. Just wanted to write those ideas before forgetting ...

comment:6 Changed 4 years ago by laurentj

No news ?

comment:7 Changed 3 years ago by laurentj

  • Status changed from new to confirmed
  • review review- deleted

comment:8 Changed 2 years ago by bricet

  • Status changed from confirmed to closed
  • Resolution set to fixed

I finally solved the bug with https://github.com/jelix/jelix/pull/92 and it was accepted strait forward ... I just can not believe it ! ;) I think we can now set this ticket as fixed, now ...

Note: See TracTickets for help on using tickets.