Moodle

Blocks width not respected when showing blocks on resources pages

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.8.2
  • Fix Version/s: 2.0
  • Component/s: Resource
  • Labels:
    None
  • Database:
    Any
  • Affected Branches:
    MOODLE_18_STABLE
  • Fixed Branches:
    MOODLE_20_STABLE

Description

The problem mostly appears when using custom sized blocks and custom themes. To reproduce:

0. in admin, enable "showbloksonmodpages"
1. create a custom theme (or edit a standard one), and add the following lines to the theme's config.php

$THEME->block_l_min_width = 210;
$THEME->block_l_max_width = 210;
$THEME->block_r_min_width = 210;
$THEME->block_r_max_width = 210;

2. now show a course home page: blocks are resized to 210 pixel width, according to the above directives
3. add a web page resource and select "show blocks"
4. when Moodle shows the resource, the blocks are truncated at 180 pixel width

Possible solutions:
1. avoid hard coding the blocks pixel width, leaving it as CSS responsibility
2. modify line 191 of mod/resource/lib.php (code below) allowing the the code to keep into consideration the specified block width in theme's config.php
$blocks_preferred_width = bounded_number(180, blocks_preferred_width($pageblocks[BLOCK_POS_RIGHT]), 210);

Activity

Hide
Eleanor Martin added a comment -

I'd prefer the first option outlined - it makes much more sense to leave this as CSS on the class rather than hard-coding.

Show
Eleanor Martin added a comment - I'd prefer the first option outlined - it makes much more sense to leave this as CSS on the class rather than hard-coding.
Hide
Petr Škoda (skodak) added a comment -

Should be finally fixed in 2.0, no more changes are planned in 1.9.xm sorry.
Thank you for the report.

Petr Skoda

Show
Petr Škoda (skodak) added a comment - Should be finally fixed in 2.0, no more changes are planned in 1.9.xm sorry. Thank you for the report. Petr Skoda

People

Vote (2)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: