No support for versions

Crell - January 14, 2009 - 07:16
Project:CSS
Version:6.x-1.0-rc1
Component:Code
Category:bug report
Priority:critical
Assigned:fax8
Status:needs review
Description

The current implementation does not support node versions at all. It needs to, as otherwise there is no way to roll back CSS changes along with a revision.

#1

fax8 - January 19, 2009 - 10:02
Assigned to:Anonymous» fax8

I agree. I'm working on this one.

#2

fax8 - January 19, 2009 - 11:13

The attached patch implements support for node revisions in css module.

Please test this patch. These are the tests I'm interested:

  • DB schema update process (running update.php)
  • New DB creation (brand new install)
  • CSS module uninstall process
  • Node creation with CSS
  • Node creation without CSS
  • Node update without new CSS
  • Node update with new CSS
  • Node update with new CSS and new revision
  • Node update withot new CSS and new revision
  • Node delete
  • Node revision delete
  • Node revision revert
AttachmentSize
css.revisions.patch 6.66 KB

#3

fax8 - January 19, 2009 - 11:38

The above patch change the behaviour of using @import "?q=css/get/x"; to reference the CSS rules of other nodes.
Before x was the nid (node id) while it is now the vid (version id).

I'm not sure if it could be useful also a way to reference the latest CSS version of a css attached to a node.

With the implementation in the patch if one reference a CSS attached to a specified version of a node, and then a new version of the referenced css is available, nodes referencing the old version will be not updated with the new versions.

Probably the best workaround would be provide another hook (eg. css/get_nid/x) where x is now the nid. This hook would always returns the latest revision of the CSS.

Any other idea?

#4

Crell - January 19, 2009 - 16:46
Status:active» needs review

I'd actually argue that we should move away from the dynamic call, as that results in two hits against Drupal. Instead, do what imagecache does a and feed in a path to drupal_add_css() (that may need to be uncacheable) that points to $files_dir/nodecss/$nid, which in turn is a menu callback that generates a file at that location. That would avoid the second hit against Drupal itself on subsequent requests. That's probably a separate issue, though.

It probably does make sense to go by vid here, though. I'll try to test this patch when sometime soon.

#5

whispero - March 13, 2009 - 09:49

Hi,

Just chasing this up.. Has this patch been tested yet and if so what feedback if any is there?

- Whispero

#6

Crell - March 13, 2009 - 14:52

Unfortunately I had a number of things explode on me in the past few weeks so I've not been able to do so. I'll let you know when I do. :-/

#7

whispero - March 23, 2009 - 15:07

Ok Crell,

No probs

- Whispero

#8

fax8 - June 29, 2009 - 07:55

Still looking for feedback for the patch above. Anyone helps?

 
 

Drupal is a registered trademark of Dries Buytaert.