Reviewed:  https://reviews.mahara.org/6945
Committed: 
https://git.mahara.org/mahara/mahara/commit/058a00ea784980dc5a148eb4c082785a4485300c
Submitter: Robert Lyon (robe...@catalyst.net.nz)
Branch:    master

commit 058a00ea784980dc5a148eb4c082785a4485300c
Author: Cecilia Vela Gurovic <ceci...@catalyst.net.nz>
Date:   Thu Sep 8 10:00:09 2016 +1200

Bug 1620416: replace all $smarty->assign_by_ref()
with $smarty->assign()
behatnotneeded

Change-Id: I667463b7732bd3f1dd2619b2836cf4b8c560d264

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

Title:
  Use of assign_by_ref() is not clear as to what is required

Status in Mahara:
  Fix Committed

Bug description:
  In Mahara we have a bunch of $smarty->assign_by_ref('item',
  $variable);

  It was originally added to smarty/dwoo due to the following

  "The assign_by_ref() original intention in Smarty 2 was to work around
  the object-by-copy behavior of PHP4."

  "The _by_ref methods have been introduced in Smarty2 mainly to be able
  to pass objects to the templates in PHP4. In PHP5 these are passed
  alway as a reference."

  But it doesn't look like we use them in a true reference sort of way

  What I mean is, this example shows referenced vs not referenced
  'title' variable:

  $smarty = smarty();
  $title = 'cats';
  $smarty->assign('title', $title);
  $smarty->assign_by_ref('titleref', $title);
  $title = 'dogs';
  $smarty->display('template.tpl'); 

  In the template it will display 'cat' as title and 'dogs' as titleref
  rather than 'cat'.

  We don't support PHP4 and so should clean up the code and make the
  assign_by_ref() calls simply assign() where appropriate to make the
  code clear as to what we are wanting.

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

_______________________________________________
Mailing list: https://launchpad.net/~mahara-contributors
Post to     : mahara-contributors@lists.launchpad.net
Unsubscribe : https://launchpad.net/~mahara-contributors
More help   : https://help.launchpad.net/ListHelp

Reply via email to