← Back to team overview

mahara-contributors team mailing list archive

[Bug 1366622] Re: width of gallery not set correctly

 

Reviewed Patch on "master" branch AND "1.9_STABLE" branch.

Before patch the user when set width = "blank" for a image gallery, it will be accepted as "blank" and the pictures would not show,.
But after patch the width when set to "blank" and the settings are saved, the width goes back to the default setting. But after reloading the page an Error message will appear. Below the steps I did.

Log in as admin
Go to Portfolio
Click on Create page
Page Title “Testing Bug”
Save settings
Go to Edit content
Click on Media → Image Gallery
Load images
Set Width to “blank”
Save settings
Inspecting the code and confirm that width is set to “blank”

-- 
You received this bug notification because you are a member of Mahara
Contributors, which is subscribed to Mahara.
Matching subscriptions: Subscription for all Mahara Contributors -- please ask on #mahara-dev or mahara.org forum before editing or unsubscribing it!
https://bugs.launchpad.net/bugs/1366622

Title:
  width of gallery not set correctly

Status in Mahara ePortfolio:
  Confirmed
Status in Mahara 1.10 series:
  Confirmed
Status in Mahara 1.11 series:
  In Progress
Status in Mahara 1.9 series:
  Confirmed

Bug description:
  When creating an image gallery, a user can 'blank' out the 'Width'
  field.

  When the block is instantiated, the $configdata['width'] is set but
  it's empty.

  So, the $width is also empty.

  i.e. $width = isset($configdata['width']) ? $configdata['width'] : 75;

  I think the switch at the top should also check for '&&
  $configdata['width'] > 0':

  i.e.

  switch ($style) {
  case 0: // thumbnails
  $template = 'thumbnails';
  $width = isset($configdata['width']) && $configdata['width'] > 0 ? $configdata['width'] : 75;
  break;
  case 1: // slideshow
  $template = 'slideshow';
  $width = isset($configdata['width']) && $configdata['width'] > 0 ? $configdata['width'] : 400;
  break;
  case 2: // square thumbnails
  //default:
  $template = 'squarethumbs';
  $width = isset($configdata['width']) && $configdata['width'] > 0 ? $configdata['width'] : 75;
  break;
  }

  Hope that makes sense.

To manage notifications about this bug go to:
https://bugs.launchpad.net/mahara/+bug/1366622/+subscriptions


References