Moodle

IE7 continually adds new content to the page when rating forums

Details

  • Type: Sub-task Sub-task
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 1.9.3
  • Fix Version/s: 1.9.4
  • Component/s: Forum
  • Labels:
    None
  • Difficulty:
    Easy
  • Affected Branches:
    MOODLE_19_STABLE
  • Fixed Branches:
    MOODLE_19_STABLE

Description

1) Go to any Using Moodle forum on moodle.org eg
2) Rate a post
3) Unrate the post by selecting the first item in the menu
4) Repeat 2 and 3, it looks like this screenshot.

Activity

Hide
Eloy Lafuente (stronk7) added a comment -

Wow!

I thought I had tested that. And results are accumulated on the right. And those nulls.. crazy! Looking to it now.

Show
Eloy Lafuente (stronk7) added a comment - Wow! I thought I had tested that. And results are accumulated on the right. And those nulls.. crazy! Looking to it now.
Hide
Eloy Lafuente (stronk7) added a comment -

The printout of "null" is easy to fix. Only IE does that (instead of printing nothing).

And, curiously, the problem about rating texts being accumulated and accumulated on the right is caused because one "fallback code" I added, that only should be executed if no previous "forumpostratingtext" span is found. And that should happen never, because that span always exist. But IE7 isn't able to find it.

This is the line not finding the span, that is 100% YUI code, is this:

var ratingsSpan = YAHOO.util.Dom.getFirstChildBy(ratingsDiv, function(el){return el.getAttribute('class') == 'forumpostratingtext';});

I'll investigate a bit more and will try some workaround to make it work under IE7 (grrr). Ciao

Show
Eloy Lafuente (stronk7) added a comment - The printout of "null" is easy to fix. Only IE does that (instead of printing nothing). And, curiously, the problem about rating texts being accumulated and accumulated on the right is caused because one "fallback code" I added, that only should be executed if no previous "forumpostratingtext" span is found. And that should happen never, because that span always exist. But IE7 isn't able to find it. This is the line not finding the span, that is 100% YUI code, is this: var ratingsSpan = YAHOO.util.Dom.getFirstChildBy(ratingsDiv, function(el){return el.getAttribute('class') == 'forumpostratingtext';}); I'll investigate a bit more and will try some workaround to make it work under IE7 (grrr). Ciao
Hide
Eloy Lafuente (stronk7) added a comment -

I have changed the problematic js line:

var ratingsSpan = YAHOO.util.Dom.getFirstChildBy(ratingsDiv, function(el){return el.getAttribute('class') == 'forumpostratingtext';});

to:

var ratingsSpan = YAHOO.util.Dom.getFirstChildBy(ratingsDiv, function(el){return YAHOO.util.Dom.hasClass(el,'forumpostratingtext');});

that uses an alternate way to check for element classes and, luckily, it seems to work in all the browsers. B-)

Show
Eloy Lafuente (stronk7) added a comment - I have changed the problematic js line: var ratingsSpan = YAHOO.util.Dom.getFirstChildBy(ratingsDiv, function(el){return el.getAttribute('class') == 'forumpostratingtext';}); to: var ratingsSpan = YAHOO.util.Dom.getFirstChildBy(ratingsDiv, function(el){return YAHOO.util.Dom.hasClass(el,'forumpostratingtext');}); that uses an alternate way to check for element classes and, luckily, it seems to work in all the browsers. B-)
Hide
Eloy Lafuente (stronk7) added a comment -

So, fixed. Not sure why the 1st syntax doesn't work but... who cares. It's IE7. Ciao

P.S.: I'm going to CVS update that file in moodle.org to have it working ok ASAP. It doesn't interfere with anything else.

Show
Eloy Lafuente (stronk7) added a comment - So, fixed. Not sure why the 1st syntax doesn't work but... who cares. It's IE7. Ciao P.S.: I'm going to CVS update that file in moodle.org to have it working ok ASAP. It doesn't interfere with anything else.
Hide
Martin Dougiamas added a comment -

Tested OK. Fantastic, thanks!

Show
Martin Dougiamas added a comment - Tested OK. Fantastic, thanks!

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: