Needs review
Project:
Dynamic Rendering
Version:
6.x-1.x-dev
Component:
sIFR plugin
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
9 Jul 2009 at 15:01 UTC
Updated:
16 Dec 2009 at 15:49 UTC
Jump to comment: Most recent file
Comments
Comment #1
seanrUgh, damned thing isn't saving the value and I have no idea why.
Comment #2
seanrBetter patch here (now saves and outputs correctly). Not sure it actually does what the wiki says its supposed to though.
Comment #3
lasseitorp commentedI can't get this to work even with the new patch.
The checkbox comes up in the module, but there's no output in the object tag.
Has anyone got this going??
Comment #4
kla2t commentedI had the same problem and couldn't get the patch to work. Obviously the sifr3.inc - even in the patched version - does not influence the output regarding the preventWrap / forceSingleLine parameters. They always equal "false".
The error seems to be in the sifr.js file. I simplified the variables
var AN=x.forceSingleLine===true;
var AS=x.preventWrap===true&&!AN;
to
var AN=true;
var AS=true;
and now there are no more irregular line breaks.
I don't know if this could cause new issues, but as a dirty hack it does the job for me.
Comment #5
armyofda12mnkeys commentedthink i know the problem, just not the solution :) (got a temp solution though by using the last patch and manually changing the created sites/default/files/render/sifr3-rules.js) ...
Think this is what is happening:
user submits rule or cache is cleared etc...
render_get_rules() then is called to get (or create static $rules)
render_render_rules_js() is what builds the js files...
it calls a wrapper function render_wrap_rules() with those $rules, which calls sifr3.inc's sifr3_render_wrap_rules() with all the parameters for the rule in an array...
The output of the file is being created here... for certain parameters you dont want them as a simple 'string key, string value' combo.
aka not "forceSIngleLine":"true" but you want forceSIngleLine:true...
I set the value hardcoded straight in my sifr3-rules.js file, and it worked. so its now just getting that function to do that for certain values.
Basically it calls drupal_to_js() to take the $rules array and encode it into a js array. i think we need to get rid of that add just loop through and create the array manually maybe (since we dont want to change the core function)?
OR??
change sifr.js so it can parse this true value?
Comment #6
armyofda12mnkeys commentedDoing some ghettoness now, but its a solution if dont want to manually change the file ... file attached, not using drupal_to_js but a slight variation sifr3_to_js ...
For string values... If the string value is 'true', then dont return as '"true"' but 'true', so the value in js file is true and not "true".
Patch is against the render modules original sifr3.inc so it includes the changes in the above patch as well (aka run this against original sifr3.inc).
Comment #7
kla2t commented...applied the patch successfully!
Obviously it is much better than my hard-coded hack above. And it opens the possibilty to attribute different forceSingleLine / preventWrap values to different sifr-rules.
Thanks!