Development

#2685 (Partial and component cache don't include stylesheets)

You must first sign up to be able to contribute.

Ticket #2685 (reopened defect)

Opened 1 year ago

Last modified 7 months ago

Partial and component cache don't include stylesheets

Reported by: francois Assigned to: fabien
Priority: major Milestone:
Component: cache Version: 1.0.9
Keywords: Cc:
Qualification: Unreviewed

Description

The view.yml configuration and the use_stylesheet() helper allow a partial (or a component) to include a stylesheet or a javascript.

This is very useful for portlet-like components, who need to embed their own formatting and behaviors.

The problem is that the get_partial() helper just outputs the cached HTML code of the partial if found, without any consideration for included stylesheets.

branches/1.0/lib/helper/PartialHelper.php

Although it is properly done for actions without layout (where it's an object that is put in cache, not some HTML code), the cache doesn't work properly for partials and components.

A good workaround for JavaScripts? is to write a JavaScript include tag directly in the template, but doing the same for stylesheets is not XHTML compliant.

Attachments

PartialHelper.diff.txt (3.1 kB) - added by noel on 04/04/08 16:30:11.

Change History

01/02/08 09:55:36 changed by fabien

  • milestone set to 1.0.11.

I don't see how we can fix this bug, which quite annoying.

The minimum we can do is to find a way to disallow usage of use_stylesheet() and use_javascript() in helpers.

01/03/08 22:01:22 changed by francois

can't we serialize a sfPartialView object and write that to cache?

01/21/08 10:14:18 changed by gregoire

Shall we set the milestone to the 1.0.12 so we can release the 1.0.11 ?

01/22/08 09:09:08 changed by gregoire

  • milestone changed from 1.0.11 to 1.0.12.

sorry, it will be for the next release :o)

01/22/08 15:57:19 changed by Andrejs.Verza

Cache system also doesn't remember written slots:

<?php slot('some_slot'); ?>
  This works only if not cached.
<?php end_slot(); ?>

03/03/08 15:00:44 changed by fabien

  • status changed from new to closed.
  • resolution set to fixed.

(In [7725]) fixed caching of partial and components (now with css, js, and slots support) (closes #2685)

03/03/08 15:01:34 changed by fabien

  • status changed from closed to reopened.
  • resolution deleted.

03/21/08 11:02:47 changed by noel

  • milestone changed from 1.0.12 to 1.0.13.

It will be for the next release ;)

04/01/08 17:36:07 changed by gregoire

  • milestone changed from 1.0.13 to 1.0.14.

04/04/08 16:30:11 changed by noel

  • attachment PartialHelper.diff.txt added.

04/04/08 16:33:23 changed by noel

I've attached a patch for partial/component cache support.

Can you give your feedback about it? Thanks.

04/28/08 22:14:39 changed by FabianLange

why is this reopened? r7725 not doing the trick?

04/28/08 22:37:53 changed by noel

No, this changeset just fixes the 1.1 branche, not the 1.0.

05/05/08 09:50:17 changed by fabien

  • milestone deleted.

After many hours on this issue, I'm not sure if we can/want to fix this in 1.0 as it involves so many changes to make it work reliably.