Moodle

Site news - forum length setting has no effect for certain users

Details

  • Type: Bug Bug
  • Status: Reopened Reopened
  • Priority: Major Major
  • Resolution: Unresolved
  • Affects Version/s: 1.5.3, 1.9, 2.0.1, 2.2
  • Fix Version/s: STABLE backlog
  • Component/s: Forum
  • Labels:
  • Environment:
    All
  • Database:
    MySQL
  • Affected Branches:
    MOODLE_15_STABLE, MOODLE_19_STABLE, MOODLE_20_STABLE, MOODLE_22_STABLE

Description

Please see http://moodle.org/mod/forum/discuss.php?d=39697 and http://moodle.org/mod/forum/discuss.php?d=36918

This makes it very messy to use news as the option for the front page.

No difference if viewed in i.e. or firefox.

Activity

Hide
Vy-Shane Sin Fat added a comment -

I could not reproduce this with the latest 1.5, nor with the latest 1.6. This is an old bug. Maybe it's already been fixed?

Show
Vy-Shane Sin Fat added a comment - I could not reproduce this with the latest 1.5, nor with the latest 1.6. This is an old bug. Maybe it's already been fixed?
Hide
Helen Foster added a comment -

Reopening this issue, as it remains a problem in Moodle 1.9.

See also http://moodle.org/mod/forum/discuss.php?d=94543

Show
Helen Foster added a comment - Reopening this issue, as it remains a problem in Moodle 1.9. See also http://moodle.org/mod/forum/discuss.php?d=94543
Hide
Helen Foster added a comment -

Just tested with latest 1.9+, and found that, with defaultfrontpageroleid set to student, an admin sees the reduced length site news item, whereas a student sees the full length item.

Show
Helen Foster added a comment - Just tested with latest 1.9+, and found that, with defaultfrontpageroleid set to student, an admin sees the reduced length site news item, whereas a student sees the full length item.
Hide
Petr Škoda (skodak) added a comment -

I think I fixed this recently, please reopen if you can replicate this...

thanks!

Show
Petr Škoda (skodak) added a comment - I think I fixed this recently, please reopen if you can replicate this... thanks!
Hide
Helen Foster added a comment -

Reopening, as the problem remains in the latest 1.9+. Also, if the front page is set to display news items, then non-logged in users also see the full-length site news item.

Show
Helen Foster added a comment - Reopening, as the problem remains in the latest 1.9+. Also, if the front page is set to display news items, then non-logged in users also see the full-length site news item.
Hide
Petr Škoda (skodak) added a comment -

I have checked the code, the problem is that forum_shorten_post($message) uses a very simplified algorithm that does not work in many cases - it is not unicode aware at all.

Solution would be to rewrite it completely and use tidyhtml or htmlpurifier, in anycase this will require a lot of work

Show
Petr Škoda (skodak) added a comment - I have checked the code, the problem is that forum_shorten_post($message) uses a very simplified algorithm that does not work in many cases - it is not unicode aware at all. Solution would be to rewrite it completely and use tidyhtml or htmlpurifier, in anycase this will require a lot of work
Hide
Petr Škoda (skodak) added a comment -

hmm, maybe we could do some shortening using javascrip instead - like a small +/- icon at the bottom of longer posts...

Show
Petr Škoda (skodak) added a comment - hmm, maybe we could do some shortening using javascrip instead - like a small +/- icon at the bottom of longer posts...
Hide
Helen Foster added a comment -

Just noting another discussion about this problem:
http://moodle.org/mod/forum/discuss.php?d=134924

Show
Helen Foster added a comment - Just noting another discussion about this problem: http://moodle.org/mod/forum/discuss.php?d=134924
Hide
Dušan Risti? added a comment -

Using Moodle 1.9.9+ build 20100908

Just hit this problem today, users that aren't registered/loged in are shown full text instead of short version with link.

Made a fix and still not seeing any side effects. In moodle/mod/forum/lib.php line 4939 should look like:

$link = forum_user_can_post($forum, $discussion, $USER, $cm, $course, $modcontext);

I've just replaced it with:

$link = forum_user_can_see_post($forum, $discussion, $post, $USER, $cm);

It doesn't seems to be afecting other controls (edit/delete).

Show
Dušan Risti? added a comment - Using Moodle 1.9.9+ build 20100908 Just hit this problem today, users that aren't registered/loged in are shown full text instead of short version with link. Made a fix and still not seeing any side effects. In moodle/mod/forum/lib.php line 4939 should look like: $link = forum_user_can_post($forum, $discussion, $USER, $cm, $course, $modcontext); I've just replaced it with: $link = forum_user_can_see_post($forum, $discussion, $post, $USER, $cm); It doesn't seems to be afecting other controls (edit/delete).
Hide
Petr Škoda (skodak) added a comment -

reassigning to HQ

Show
Petr Škoda (skodak) added a comment - reassigning to HQ
Hide
Helen Foster added a comment -

Just checked and found 2.0.1 still affected by this issue. Only admins see shorted news forum posts. Non-logged in users, students and guests all see the full-length post.

Show
Helen Foster added a comment - Just checked and found 2.0.1 still affected by this issue. Only admins see shorted news forum posts. Non-logged in users, students and guests all see the full-length post.
Hide
Susan Mangan added a comment -

I guess our posts haven't been incredibly long until now as I JUST noticed this bug!! ... after years of using Moodle. crazy. I log in as Admin to post messages on the front page and it always shortens so I never doubted it!!! Anyway - fyi another potential workaround that may or may not work for you is to post your full entry as a Site Event and hyperlink to it from the News Forum where you can post a shorter blurb there.

Show
Susan Mangan added a comment - I guess our posts haven't been incredibly long until now as I JUST noticed this bug!! ... after years of using Moodle. crazy. I log in as Admin to post messages on the front page and it always shortens so I never doubted it!!! Anyway - fyi another potential workaround that may or may not work for you is to post your full entry as a Site Event and hyperlink to it from the News Forum where you can post a shorter blurb there.
Hide
Chris Murad added a comment -

I am encountering this Bug on 2.1 as well.

Show
Chris Murad added a comment - I am encountering this Bug on 2.1 as well.
Hide
Helen Foster added a comment -

Thanks Chris, also in 2.2.

Show
Helen Foster added a comment - Thanks Chris, also in 2.2.

Dates

  • Created:
    Updated: