Is there anything on the horizon to allow for revisions in templates? I've been getting into some fairly complex ones lately, and it would sure be nice to be able to get back to a stable template after I've forgotten a closing paren somewhere in my PHP resulting in a WSOD. Copying and stashing the working template so I can recreate it later in case of an id10t works, but being able to return to an earlier version sure would be handy. I'm thinking about trying to modify Contemplate to add this myself, but wanted to check first to make sure I wouldn't be duplicating an effort.

Even w/o revisions, this is one of my favorite modules. Thanks for putting it out there for us!

SB

CommentFileSizeAuthor
#5 contemplate.png43.35 KBsunset_bill
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dgtlmoon’s picture

Sounds like a good idea. I wonder if it's worth going all the way and making contemplate templates node's ?

perhaps some simple revisioning could be good.

but then that would make our work with setting the template's as something you can StrongArm unfeasable

dgtlmoon’s picture

Or maybe the broader issue is being able to test that a template functions without WSOD and gives you back what you expect?

dgtlmoon’s picture

Oh yes, and there is already a patch that is being worked on so you can set the templates in your settings.php etc using strongarm.

So correct me if i'm wrong, but i think you just need something to 'test' that it executes OK?

sunset_bill’s picture

Just being able to test without crashing would be great. Setting templates in settings.php sounds like a cool thing, too.

thanks,
SB

sunset_bill’s picture

FileSize
43.35 KB

Greetings,

I've been playing around with adding revisions, basically by creating a contemplate_revisions table and giving the user an option of saving a revision when a template is doing what they want (no point in wasting DB space on a bunch of experiments). It's almost there (see screenshot), but what I need now is to be able to get a chosen date in contemplate_edit_type_form(). Unfortunately, while this function does have &$form_state as its first parameter, at the time the function executes, there's not much of anything in $form_state, especially $form_state{'values']['revision'], which holds the value of the revision the user has selected to load.

I've been trying various things over the past couple days, and I'm now basically thrashing. Rather than passing around a param, I've even tried using a global variable and checking in contemplate_get_template() to see if it's set and, if it is, fetching a revision instead of the regular template. No luck so far.

A. Would this interfere with StrongArm?
B. If not, do you have any ideas how I can get the selected date to contemplate_get_template()?

cheers,
SB