Non-core contributed modules

When the block is visible, the 'add blocks' bit is hidden

Details

  • Type: Sub-task Sub-task
  • Status: Resolved Resolved
  • Priority: Critical Critical
  • Resolution: Fixed
  • Affects Version/s: 1.9.5
  • Fix Version/s: 1.9.7
  • Component/s: Block: AJAX Marking
  • Labels:
    None
  • Affected Branches:
    MOODLE_19_STABLE
  • Fixed Branches:
    MOODLE_19_STABLE

Description

Can't reproduce this, so it must be something specific to one install.

When the block is set to hidden, the page reloads witht he 'add blocks' bit visible.

Activity

Hide
Matt Gibson added a comment -

Code from line 358 of /liub/blocklib.php:

include_once($CFG->dirroot.'/my/pagelib.php');

$coursecontext = get_context_instance(CONTEXT_COURSE, $COURSE->id);
$myownblogpage = (isset($page->filtertype) && isset($page->filterselect) && $page->type=='blog-view' && $page->filtertype=='user' && $page->filterselect == $USER->id);

$managecourseblocks = has_capability('moodle/site:manageblocks', $coursecontext);
$editmymoodle = $page->type == PAGE_MY_MOODLE && has_capability('moodle/my:manageblocks', $coursecontext);

if ($page->blocks_default_position() == $position &&
$page->user_is_editing() &&
($managecourseblocks || $editmymoodle || $myownblogpage || defined('ADMIN_STICKYBLOCKS'))) { blocks_print_adminblock($page, $pageblocks); }

Presumably some part of this changes with the show/hide action.

Show
Matt Gibson added a comment - Code from line 358 of /liub/blocklib.php: include_once($CFG->dirroot.'/my/pagelib.php'); $coursecontext = get_context_instance(CONTEXT_COURSE, $COURSE->id); $myownblogpage = (isset($page->filtertype) && isset($page->filterselect) && $page->type=='blog-view' && $page->filtertype=='user' && $page->filterselect == $USER->id); $managecourseblocks = has_capability('moodle/site:manageblocks', $coursecontext); $editmymoodle = $page->type == PAGE_MY_MOODLE && has_capability('moodle/my:manageblocks', $coursecontext); if ($page->blocks_default_position() == $position && $page->user_is_editing() && ($managecourseblocks || $editmymoodle || $myownblogpage || defined('ADMIN_STICKYBLOCKS'))) { blocks_print_adminblock($page, $pageblocks); } Presumably some part of this changes with the show/hide action.
Hide
Larry M Elchuck, Ph.D. added a comment -

I've reporduced it on a clean install as well as an existing install Matt ... both are updated weekly via CVS.

Are you suggesting doing something with the code you posted on July 24th?

thanks

larry

Show
Larry M Elchuck, Ph.D. added a comment - I've reporduced it on a clean install as well as an existing install Matt ... both are updated weekly via CVS. Are you suggesting doing something with the code you posted on July 24th? thanks larry
Hide
Matt Gibson added a comment -

Hi Larry,

thanks a million for the email you sent - I hadn't tried testing using a teacher account, only with the admin one (d'oh!), which probably explains why I couldn't reprodcue it. I'll get onto it over the weekend once the start of term rush has settled and will get you a fix soon.

Show
Matt Gibson added a comment - Hi Larry, thanks a million for the email you sent - I hadn't tried testing using a teacher account, only with the admin one (d'oh!), which probably explains why I couldn't reprodcue it. I'll get onto it over the weekend once the start of term rush has settled and will get you a fix soon.
Hide
Larry M Elchuck, Ph.D. added a comment - - edited

I was guilty of the same thing Matt .. I played that " Well it works for me" line on a couple of my teachers .... lol
It was when I logged in as one that I saw that they were right!
Good to know you are on it ... take your time ... I know how hectic this time of year is for everyone

BTW, when you do a fix, can you provide a CVS version for Moodle 1.9.5+

thanks

larry

Show
Larry M Elchuck, Ph.D. added a comment - - edited I was guilty of the same thing Matt .. I played that " Well it works for me" line on a couple of my teachers .... lol It was when I logged in as one that I saw that they were right! Good to know you are on it ... take your time ... I know how hectic this time of year is for everyone BTW, when you do a fix, can you provide a CVS version for Moodle 1.9.5+ thanks larry
Hide
Larry M Elchuck, Ph.D. added a comment -

One other side effect Matt ... unless the current version of the block is deleted from a course, if the online users block is present for the course, it shows all users logged into the site, not just the ones logged into the course.

larry

Show
Larry M Elchuck, Ph.D. added a comment - One other side effect Matt ... unless the current version of the block is deleted from a course, if the online users block is present for the course, it shows all users logged into the site, not just the ones logged into the course. larry
Hide
Larry M Elchuck, Ph.D. added a comment -

Another interesting discovery Matt

Re: Calendar issues
by Guy Aucoin - Thursday, 10 September 2009, 11:07 AM
To add another interesting fact to this situation; do not place the marking block above the calendar or quickmail as it will not allow them to work. If it is placed below them, they are OK.

Guy

Show
Larry M Elchuck, Ph.D. added a comment - Another interesting discovery Matt Re: Calendar issues by Guy Aucoin - Thursday, 10 September 2009, 11:07 AM To add another interesting fact to this situation; do not place the marking block above the calendar or quickmail as it will not allow them to work. If it is placed below them, they are OK. Guy
Hide
Matt Gibson added a comment -

Thanks for the extra info Larry. I'm on the case, but it's proving tricky...

Show
Matt Gibson added a comment - Thanks for the extra info Larry. I'm on the case, but it's proving tricky...
Hide
Matt Gibson added a comment -

Got it! I used require_login(1, false) instead of require_login(0, false). Fix in CVS now.

Show
Matt Gibson added a comment - Got it! I used require_login(1, false) instead of require_login(0, false). Fix in CVS now.
Hide
Larry M Elchuck, Ph.D. added a comment -

Hi Matt

Thanks for looking at this

I installed n one box I support and do not seeany abilities as an admin or teacher role. Might I be missing something?
larry

Show
Larry M Elchuck, Ph.D. added a comment - Hi Matt Thanks for looking at this I installed n one box I support and do not seeany abilities as an admin or teacher role. Might I be missing something? larry
Hide
Larry M Elchuck, Ph.D. added a comment -

As per my last comment, Matt
larry

Show
Larry M Elchuck, Ph.D. added a comment - As per my last comment, Matt larry
Hide
Matt Gibson added a comment -

That's odd. I've got the same thing here even though it was fine when I committed those files. Must be to do with starting a new session.

Show
Matt Gibson added a comment - That's odd. I've got the same thing here even though it was fine when I committed those files. Must be to do with starting a new session.
Hide
Matt Gibson added a comment -

Turns out my version of the above was due to an incomplete page load. I've had a play around with this and found that I can only reproduce it by having no teacher roles, in which case the block should not show except when editing is on, as in the screenshot above (students ought not to see it, even if it's empty).

Larry, does your user account on that box definitely have a teacher role in a specific course, rather than a general whole-site one?

Show
Matt Gibson added a comment - Turns out my version of the above was due to an incomplete page load. I've had a play around with this and found that I can only reproduce it by having no teacher roles, in which case the block should not show except when editing is on, as in the screenshot above (students ought not to see it, even if it's empty). Larry, does your user account on that box definitely have a teacher role in a specific course, rather than a general whole-site one?
Hide
Matt Gibson added a comment -

Having a tidy up in the tracker, so I'm resolving this one assuming it's fixed. Let me know if otherwise.

Show
Matt Gibson added a comment - Having a tidy up in the tracker, so I'm resolving this one assuming it's fixed. Let me know if otherwise.

People

Vote (0)
Watch (2)

Dates

  • Created:
    Updated:
    Resolved: