Inserting a new line when a vote is not '0'

VladSavitsky - November 27, 2007 - 11:09
Project:Simple Karma
Version:5.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

I have reinstalled D5.3 and updated Simple Karma from CVS today (27.11.2007).
1.Nothing Changed in Drupal. Just install Simple Karma and apply changes described in Install.txt
2. Set (at modules config page) "Node types that will accept karma" - for Page and Story.
3.Set ranges for roles karma_1 and karma_2. [1-111], [111-1111]

I can't enter more than 4 digits....

This is all changes. Than I have created a page....
In FF I see a drop-down menu with button for node. JS is anabled. So it looks like no JS found for this browser.

When I choose a voting points (-2) and press button "Vote" page reloads but Total Amount not changed. New line was added before a karma-form. See a screenshot http://drupal.org/files/karma10.png.
When I set to "0" new line not inserted. All other values (-1...-3) leads to inserting new line.

Code when I choose "-1":

        <form action="/ekklesia/simple_karma/handle" method="get" class="karma_form" id="y1">
          <div class="has_negative_karma"></div>
          <span class="karma_score">0</span>
          <span class="karma_buttons">

            <select name="karma_vote"><option value="0">0 </option><option value="-1" selected="selected">-1 </option><option value="-2">-2 </option><option value="-3">-3 </option>
            </select>
            <input name="oid" value="1" type="hidden">
            <input name="otype" value="n" type="hidden">
            <input name="form_style" value="2" type="hidden">
            <input name="form_type" value="form" type="hidden">
            <input name="submit" value="Vote" type="submit">
           
          </span>

        </form>

Code when I choose "0":

        <form action="/ekklesia/simple_karma/handle" method="get" class="karma_form" id="y1">
         
          <span class="karma_score">0</span>
          <span class="karma_buttons">
            <select name="karma_vote"><option value="0" selected="selected">0 </option><option value="-1">-1 </option><option value="-2">-2 </option><option value="-3">-3 </option>

            </select>
            <input name="oid" value="1" type="hidden">
            <input name="otype" value="n" type="hidden">
            <input name="form_style" value="2" type="hidden">
            <input name="form_type" value="form" type="hidden">
            <input name="submit" value="Vote" type="submit">
           
          </span>
        </form>

#1

VladSavitsky - November 27, 2007 - 11:12

A screenshot

AttachmentSize
karma10.png 5.91 KB

#2

VladSavitsky - November 27, 2007 - 11:50

You are inserting this code:

<div class="has_negative_karma"></div>

This is only differs!

#3

VladSavitsky - November 27, 2007 - 11:59

Commentin a line 2861 at simple_karma.module will solve a problem:

//    $negative_karma_str='<div class="has_negative_karma"></div>';

#4

mercmobily - November 28, 2007 - 00:37

Hi,

This problem is meant to be resolved in CVS.
Do you have:

.has_negative_karma { display: inline; }

At the end of your simple_karma_js.css file?

Bye,

Merc.

#5

VladSavitsky - November 28, 2007 - 09:18

Yes, I have

#6

VladSavitsky - November 30, 2007 - 21:39

Have updated from CVS (30.11.2007) 1.11 - bug not gone.

#7

mercmobily - December 5, 2007 - 11:21

Hi,

This is driving me peculiar.
I fixed two issues:

* I can't enter more than 4 digits....

Now you can

* When I choose a voting points (-2) and press button "Vote" page reloads but Total Amount not changed.

Ah, this is because a default setting is not what it should have been: the one right at the bottom, "show the actual karma". This is bound to confuse people (in fact, it confused me!)

It's fixed now.

However, I have not been able to reproduce the enter - ever!
I've created a new version of the module, 1.12. Can you please test that one, and let me know?
Also, which theme _exactly_ are you using?

Bye,

Merc.

#8

mercmobily - December 5, 2007 - 11:50

Hi,

This is the last non-UI bug for the module. After that, I will focus on IE stuff (see the IE bugs) and feature requests.
So... well, I really want to get this fixed.

Guys, can you please install 1.13, tell me exactly what you do, make sure your caches are empty, and report back?

The module was pretty much rewritten (at least the voting part) over the last week or so. So, I am not sure anymore if the problem is still meant to be there.

Thank you!

Merc.

#9

kpaul - December 24, 2007 - 15:51

just installed 5x.1.14 and it seems to tabulate the rating ok, but the number doesn't update on IE or Firefox after you click it (the button you click does go to disabled state, though...

other modules, etc...

<style type="text/css" media="all">@import "/modules/poll/poll.css";</style>

<style type="text/css" media="all">@import "/modules/asset/asset.css";</style>
<style type="text/css" media="all">@import "/modules/cck/content.css";</style>
<style type="text/css" media="all">@import "/modules/ed_classified/ed_classified.css";</style>
<style type="text/css" media="all">@import "/modules/event/event.css";</style>
<style type="text/css" media="all">@import "/modules/feedapi/feedapi_aggregator/aggregator.css";</style>
<style type="text/css" media="all">@import "/modules/node/node.css";</style>
<style type="text/css" media="all">@import "/modules/quote/quote.css";</style>
<style type="text/css" media="all">@import "/modules/simple_karma/simple_karma_all.css";</style>
<style type="text/css" media="all">@import "/modules/system/defaults.css";</style>

<style type="text/css" media="all">@import "/modules/system/system.css";</style>
<style type="text/css" media="all">@import "/modules/user/user.css";</style>
<style type="text/css" media="all">@import "/modules/forum/forum.css";</style>
<style type="text/css" media="all">@import "/modules/comment/comment.css";</style>
<style type="text/css" media="all">@import "/themes/bluemarine/style.css";</style>
  <script type="text/javascript" src="/misc/jquery.js"></script>
<script type="text/javascript" src="/misc/drupal.js"></script>
<script type="text/javascript" src="/modules/jquery_update/compat-1.0.js"></script>

<script type="text/javascript" src="/modules/simple_karma/simple_karma.js"></script>
<script type="text/javascript" src="/modules/views_bookmark/views_bookmark.js"></script>
<script type="text/javascript" src="/modules/tinymce/tinymce/jscripts/tiny_mce/tiny_mce_gzip.js"></script>
<script type="text/javascript" src="/misc/collapse.js"></script>
<script type="text/javascript" src="/modules/jquery_update/collapse-fix.js"></script>
<script type="text/javascript">Drupal.extend({ settings: { "gmap_markermanager": [  ] } });</script>
<script type="text/javascript">var BASE_URL = "/";</script>
<script type="text/javascript">
  tinyMCE_GZ.init({
    mode : "exact",
    theme : "advanced",
    relative_urls : false,
    document_base_url : "/",
    language : "en",
    safari_warning : false,
    entity_encoding : "raw",
    verify_html : true,
    preformatted : false,
    convert_fonts_to_spans : true,
    remove_linebreaks : false,
    apply_source_formatting : true,
    theme_advanced_resize_horizontal : true,
    theme_advanced_resizing_use_cookie : true,
    width : "100%",
    height : "380",
    plugins : "youtube,advimage,emotions,fullscreen,iespell,insertdatetime,preview,table,drupalimage,media",
    theme_advanced_toolbar_location : "top",
    theme_advanced_toolbar_align : "left",
    theme_advanced_path_location : "bottom",
    theme_advanced_resizing : true,
    theme_advanced_blockformats : "p,address,pre,h1,h2,h3,h4,h5,h6",
    theme_advanced_buttons1 : "youtube,bold,italic,underline,strikethrough,justifyleft,justifycenter,justifyright,justifyfull,bullist,numlist,outdent,indent,fontselect,fontsizeselect,drupalimage",
    theme_advanced_buttons2 : "undo,link,unlink,image,cleanup,forecolor,sup,sub,hr,insertdate,preview",
    theme_advanced_buttons3 : "visualaid,removeformat,charmap,help,emotions,fullscreen,iespell,tablecontrols,media",
    extended_valid_elements : "img[class|src|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],img[class|src|border=0|alt|title|width|height|align|name]",
    plugin_insertdate_dateFormat : "%Y-%m-%d",
    plugin_insertdate_timeFormat : "%H:%M:%S",
    plugin_property : "property_value",
    content_css : "/themes/bluemarine/style.css",
    elements : "edit-comment"
  });
</script>
<script type="text/javascript">
  function mceToggle(id, linkid) {
    element = document.getElementById(id);
    link = document.getElementById(linkid);
    img_assist = document.getElementById('img_assist-link-'+ id);

    if (tinyMCE.getEditorId(element.id) == null) {
      tinyMCE.addMCEControl(element, element.id);
      element.togg = 'on';
      link.innerHTML = 'disable rich-text';
      link.href = "javascript:mceToggle('" +id+ "', '" +linkid+ "');";
      if (img_assist)
        img_assist.innerHTML = '';
      link.blur();
    }
    else {
      tinyMCE.removeMCEControl(tinyMCE.getEditorId(element.id));
      element.togg = 'off';
      link.innerHTML = 'enable rich-text';
      link.href = "javascript:mceToggle('" +id+ "', '" +linkid+ "');";
      if (img_assist)
        img_assist.innerHTML = img_assist_default_link;
      link.blur();
    }
  }
</script>
<script type="text/javascript">
  tinyMCE.init({
    mode : "exact",
    theme : "advanced",
    relative_urls : false,
    document_base_url : "/",
    language : "en",
    safari_warning : false,
    entity_encoding : "raw",
    verify_html : true,
    preformatted : false,
    convert_fonts_to_spans : true,
    remove_linebreaks : false,
    apply_source_formatting : true,
    theme_advanced_resize_horizontal : true,
    theme_advanced_resizing_use_cookie : true,
    width : "100%",
    height : "380",
    plugins : "youtube,advimage,emotions,fullscreen,iespell,insertdatetime,preview,table,drupalimage,media",
    theme_advanced_toolbar_location : "top",
    theme_advanced_toolbar_align : "left",
    theme_advanced_path_location : "bottom",
    theme_advanced_resizing : true,
    theme_advanced_blockformats : "p,address,pre,h1,h2,h3,h4,h5,h6",
    theme_advanced_buttons1 : "youtube,bold,italic,underline,strikethrough,justifyleft,justifycenter,justifyright,justifyfull,bullist,numlist,outdent,indent,fontselect,fontsizeselect,drupalimage",
    theme_advanced_buttons2 : "undo,link,unlink,image,cleanup,forecolor,sup,sub,hr,insertdate,preview",
    theme_advanced_buttons3 : "visualaid,removeformat,charmap,help,emotions,fullscreen,iespell,tablecontrols,media",
    extended_valid_elements : "img[class|src|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],img[class|src|border=0|alt|title|width|height|align|name]",
    plugin_insertdate_dateFormat : "%Y-%m-%d",
    plugin_insertdate_timeFormat : "%H:%M:%S",
    plugin_property : "property_value",
    content_css : "/themes/bluemarine/style.css",
    elements : "edit-comment"
  });

</script>
  <script type="text/javascript"> </script>
<link href="/themes/bluemarine/dropdowntab.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="/themes/bluemarine/dropdowntab.js">
/***********************************************
* Drop Down Tab Menu- ? Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/
</script>
<script type="text/javascript">
document.write('<style type="text/css" media="all">@import "/modules/simple_karma/simple_karma_js.css";</style>');

      var karma_only_one_vote = 0;
      var karma_login_page = "user/login";
      var karma_base_path = "/";
    </script>

#10

mercmobily - December 27, 2007 - 03:16
Status:active» closed

Hi,

simple_karma is now obsolete.
The new modules are:

http://drupal.org/project/extra_voting_forms
http://drupal.org/project/user_karma

I am closing this issue, since tons and tons of bug fixes were applied to the modules while dissecting simple_karma.

Please open a new issue in extra_voting_forms if the problem is still there!

Merc,

 
 

Drupal is a registered trademark of Dries Buytaert.