Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

osTicket v1.10 (stable) and Maintenance Release v1.9.15 are now available! Go get it now

Error using variable ticket.last_update in email templates

Hi,
if I use the ticket.last_update - variable in any email - template nothing does work anymore. I only get a blank site.

In the webserver - logfile I can find this entries ->

 PHP Fatal error:  Uncaught exception 'OrmException' with message 'Ticket: last_update: Feld nicht definiert' in /XXXX/web/include/class.orm.php:382\nStack trace:\n#0 /XXXX/web/include/class.orm.php(386): VerySimpleModel-
>get('last_update', NULL)\n#1 /XXXX/web/include/class.ticket.php(1881): VerySimpleModel->__get('last_update')\n#2 /XXXX/web/include/class.va
riable.php(89): Ticket->getVar('last_update', Object(VariableReplacer))\n#3 /XXXX/web/include/class.variable.php(134): VariableReplacer->getVar(Object(T
icket), 'last_update')\n#4 /XXXX/web/include/class.variable.php(168): VariableReplacer->_resolveVar('ticket.last_upd...')\n#5 /XXXX/web/incl
ude/class.variable.php(115): VariableReplacer->_parse('%{ticket.name},...')\n#6 [internal function]: VariableReplacer->replaceVars('%{ticket.name},...')\n#7 /XXXX/web/include/class.variable.php(113): array_map(Array, Array)\n#8 /XXXX/web/include/class.osticket.php(147): VariableReplacer->rep in /XXXX
/web/include/class.orm.php on line 382, referer: https://XXXX/tickets.php?id=XXX

By the way: a fulll list of the availlable variables with some explanation and how and WHERE they are usable would be very helpfull ;) SOmetimes there is a warning that a variable could cause errors - but it is working without any problems. Sometimes no warning (for example this last_update) but nothing works anymore.

Thanks for your help!

Walhalla
 

Comments

  • There is a list. Two of them.

    In the upper right hand of the Templates screen click "Supported Variables"

    Also I have maintained a list for years through the different versions.  *Although with the type-ahead in 1.10 for variables I stopped since there is a small description.

    ticket.last_update is not on either list.
  • Hi,
    "Supported Variables" doesnt contain this variable. Didnt find it. But the type-ahead knows and I can choose. OK, afterwords the hole system is unusable ... but it exists?!

    What about the error? Any solution because would be good to have this variable for update-/answer-messages.

    thanks a lot ...

    Walhalla

  • edited April 19
    The error isn't in English so I have no idea what it says.  "Feld nicht definiert'"
  • Hmmm ... "Feld nicht definiert" -> "field is not defined"!? :)

  • Well then I would say that it isn't an available variable.
  • I choosed in this "type-ahead" .... variable-selector!?!? It offers a variable (with several options) which doesnt exist???????????
  • edited April 19
    You should have selected one more period (.) to see if there was anything else you need to include for it to be a fully defined variable.


    image
    Variable.jpg
    593 x 282 - 62K
  • Hi,

    I have the same problem. Even if I put the fully defined variable, I get the same error..



    BR,
    Jim
    email.template.png
    1187 x 345 - 31K
    error.txt
    1K
  • @ blueyeguy -> I tried with and without any further options. At the end i tried all the possibillities the type-ahead assistant offers. everytime the same result: a blank, white page and nothing worked anymore.

    Unfortunately there is no complete list of the variables and/or when / where / how one can use wich variable.

    blueyeguy, you tried this variable and it is working for you??? Is there anybody out there who uses this variable? If so, would be great to know, whats going wrong.

    Thanks Walhalla

  • I thought this would be the winner, but while it doesn't cause an exception, it also doesn't insert the date into the message:

    Your ticket #%{ticket.number} was updated %{ticket.thread.lastmessage.create_date.user.full}.

    Result

    Your ticket #823282 was updated .
  • edited November 2
    Traced back to a typo in class.ticket.php


    Simply delete the underscore yourself for now in /include/class.ticket.php round line 1880:
            case 'last_update': 
                return new FormattedDate($this->last_update);

    Should be:
            case 'last_update': 
                return new FormattedDate($this->lastupdate);

    Then you can simply use: %{ticket.last_update.full} etc.
Sign In or Register to comment.