← Back to team overview

mahara-contributors team mailing list archive

[Bug 1855023] [NEW] Warning produced when adding/ editing an image gallery block

 

Public bug reported:

A warning message is being produced when adding or editing an image
gallery block (see attached screenshot)

To reproduce:
1) Log in as any user and create a page
2) Edit the page and select image gallery block, select some images, press save
expected results:
The page displays with an image gallery and no warnings
actual results:
The page displays with an image gallery and warnings:
"[WAR] 98 (blocktype/lib.php:2104) stripos() expects parameter 1 to be string, array given"

This issue is occurring because the javascript function
get_get_javascript_javascript($jsfiles) in blocktype/lib.php has been
set up to expect a non-empty file entry in its logic in its foreach
loop. This is an issue in artefact/file/blocktype/gallery/lib.php in
get_instance_javascript() which passes down an array with an empty file
entry:

            array(
                'file' => '',
                'initjs' => "$('#slideshow{$blockid}').on('slid.bs.carousel', function () {
                    $(window).trigger('colresize');
                });"
            )
The get_get_javascript_javascript($jsfiles) should be amended to handle the above input.

Version: 20.04dev

** Affects: mahara
     Importance: High
         Status: New

** Attachment added: "Screenshot_2019-12-04 TEST PAGE - Mahara.png"
   https://bugs.launchpad.net/bugs/1855023/+attachment/5309671/+files/Screenshot_2019-12-04%20TEST%20PAGE%20-%20Mahara.png

-- 
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/1855023

Title:
  Warning produced when adding/ editing an image gallery block

Status in Mahara:
  New

Bug description:
  A warning message is being produced when adding or editing an image
  gallery block (see attached screenshot)

  To reproduce:
  1) Log in as any user and create a page
  2) Edit the page and select image gallery block, select some images, press save
  expected results:
  The page displays with an image gallery and no warnings
  actual results:
  The page displays with an image gallery and warnings:
  "[WAR] 98 (blocktype/lib.php:2104) stripos() expects parameter 1 to be string, array given"

  This issue is occurring because the javascript function
  get_get_javascript_javascript($jsfiles) in blocktype/lib.php has been
  set up to expect a non-empty file entry in its logic in its foreach
  loop. This is an issue in artefact/file/blocktype/gallery/lib.php in
  get_instance_javascript() which passes down an array with an empty
  file entry:

              array(
                  'file' => '',
                  'initjs' => "$('#slideshow{$blockid}').on('slid.bs.carousel', function () {
                      $(window).trigger('colresize');
                  });"
              )
  The get_get_javascript_javascript($jsfiles) should be amended to handle the above input.

  Version: 20.04dev

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


Follow ups