← Back to team overview

mahara-contributors team mailing list archive

[Bug 1486262] Re: Problem with isset() in a template file

 

Hah, whoops, that's not a very specific link. I meant to post this:
http://php.net/manual/en/function.isset.php#refsect1-function.isset-
notes

Down in the "Notes" section:

"Warning: isset() only works with variables as passing anything else
will result in a parse error. For checking if constants are set use the
defined() function."

It's a little strange that this particular line of code is causing it.
The line (in a Dwoo file) is:

{if isset($attachments)}

I guess Dwoo must be parsing that template in such a way that
$attachments is replaced by an expression rather than a variable. Hm,
actually I think that things starting with "$" in Dwoo are not strictly
PHP variables, but are placeholders for Dwoo assignments, so it probably
is not a surprise that compiles into an expression instead of a
variable.

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

Title:
  Problem with isset() in a template file

Status in Mahara:
  In Progress
Status in Mahara 1.10 series:
  In Progress
Status in Mahara 1.9 series:
  In Progress
Status in Mahara 15.04 series:
  In Progress

Bug description:
  Getting this error

  PHP Fatal error: Cannot use isset() on the result of an expression
  (you can use "null !== expression" instead) in
  /var/lib/sitedata/.../htdocs/theme/raw/artefact/internal/blocktype/textbox/templates/content.tpl.d17.php
  on line 14

  So will fix up the relating template to not use isset() as it doesn't
  need to

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


References