← Back to team overview

mahara-contributors team mailing list archive

[Bug 1731807] [NEW] Remove unused code from lib/view.php that was never used correctly

 

Public bug reported:

I noticed a bug in the
theme/raw/templates/view/blocktypecontainerediting.tpl where there were
two closing </button> tags to the one opening <button> tag (see lines
37/38)

So I wondered why this didn't cause a problem rendering the page and
found the code would only be rendered if $configure was true.

And that would only happen if a block instance called render_editing
with $configure = true

And I noticed on view/blocks.php that happens when 
$blockid = $view->get_blockinstance_currently_being_configured();

But $view->get_blockinstance_currently_being_configured(); always
returns 0 as the set_blockinstance_currently_being_configured() is never
called.

Changing the number from 0 to a valid block number on an edit screen and
then reloading page gives all manner of errors.

Looking at the commit that added the set/get functions
09c73752c11c800dcb2bfbb6606206831f19d439 this was before 1.0 release and
doesn't look to have been implemented fully.

We should clean up this area and remove any/all code that is not
actually being used

** Affects: mahara
     Importance: Medium
         Status: Confirmed

** Changed in: mahara
    Milestone: None => 18.04.0

** Changed in: mahara
       Status: New => Confirmed

** Changed in: mahara
   Importance: Undecided => Medium

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

Title:
  Remove unused code from lib/view.php that was never used correctly

Status in Mahara:
  Confirmed

Bug description:
  I noticed a bug in the
  theme/raw/templates/view/blocktypecontainerediting.tpl where there
  were two closing </button> tags to the one opening <button> tag (see
  lines 37/38)

  So I wondered why this didn't cause a problem rendering the page and
  found the code would only be rendered if $configure was true.

  And that would only happen if a block instance called render_editing
  with $configure = true

  And I noticed on view/blocks.php that happens when 
  $blockid = $view->get_blockinstance_currently_being_configured();

  But $view->get_blockinstance_currently_being_configured(); always
  returns 0 as the set_blockinstance_currently_being_configured() is
  never called.

  Changing the number from 0 to a valid block number on an edit screen
  and then reloading page gives all manner of errors.

  Looking at the commit that added the set/get functions
  09c73752c11c800dcb2bfbb6606206831f19d439 this was before 1.0 release
  and doesn't look to have been implemented fully.

  We should clean up this area and remove any/all code that is not
  actually being used

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


Follow ups