Please login or register to participate.
Blog Post

Smart collections criteria fix until update


To a problem discussed here:

CODE FIX!! Regarding:

Login as siteadmin, go to Site Settings and add the following code to the JavaScript for web statistics support

<script type="text/javascript">
function fix_colat() {
  if ($('form[name="criteria_select"] select#criterion_type option').length <= 0) {
    $('form[name="criteria_select"] select#criterion_type').html($('form[name="criteria_select"] select#criterion_type').text());

$(document).ready(function () {
  $('form[name="criteria_select"] select#criterion_type').change(function () { fix_colat();});

As always, you are free to comment the temporary fix :) Please note that when 3.0.6 comes out you should remove this code and see how it works then :)

A javascript to automatically fix Smart Collections criteria for time being
Comments (2)
dhiraj Dec 14, 2009 08:58 PM
Hmmm... interesting jQuery hackery, this! :) + :o

Interesting point in question, though: Would it make sense to allow developers a more defined way, than above, to customize the current (already bloated) jQuery document.ready() function? Current is there in jq.cynin_custom.js in src -> ubify.viewlets -> browser, btw.

Will be looking at adding a "proper" fix for this really shortly in svn trunk, will update here when committed.
hexbin Dec 15, 2009 11:09 AM
I'm quite shure you will :D But, I just had to do something that I don't need to use FireBug till then :)... Hm... jQuery hackery? I do that all the time :D ... Good think I am not dreaming jQuery :D... And as for jQuery ... Add something as Advanced Site Admin section, and jQuery ready window there :D (just idea)